How to Add an AJAX Waiting Message for Small Search Box

Last Updated: Jun 23, 2014 05:30PM EDT

Step 1


Open the file “pc/SmallSearchBox08.asp” in a text editor.

Place the following code directly below the last line of code on the page:
 
<script language="JavaScript">
<!--
function pcf_CheckSearchBox() {
 	pcv_strTextBox = document.getElementById("smallsearchbox").value;
	if (pcv_strTextBox != "") {
		pcf_OpenModal2.open();
	}
}
//-->
</script>
<%
'// Loading Window
Response.Write(pcf_InitializePrototype())
response.Write(pcf_ModalWindow(dictLanguage.Item(Session("language")&"_advSrca_23"), "2", 200))
%>

 

Step 2


Add the JavaScript that will initiate the Pop-Up window when you click the “Search” button.

Replace the following line of code:
<form action="showsearchresults.asp" name="search" method="get" class="pcForms">
With this line of code:
<form action="showsearchresults.asp" name="search" method="get" onSubmit="pcf_CheckSearchBox();" class="pcForms">
 

Step 3


Add basic validation so the search box only shows when a keyword has been entered.

Replace the following line of code:
<input type="Text" name="keyword" size="14" value="">
With this line of code:
<input type="Text" name="keyword" size="14" value="" id="smallsearchbox" >

Menu

  • Support Forums
  • Video Tutorials
  • Support Request
  • Support Policy
647e99095133bd6d1ae916f97dc7f92f@productcart.desk-mail.com
https://cdn.desk.com/
false
desk
Loading
seconds ago
a minute ago
minutes ago
an hour ago
hours ago
a day ago
days ago
about
false
Invalid characters found
/customer/en/portal/articles/autocomplete