How to Add an AJAX Waiting Message for Small Search Box
Please note: The contents of this article apply only to licensed versions of the ProductCart software. They do not apply to stores running as a hosted application under a ProductCart Live agreement.
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" >