Announcement:Materials and articles for ProductCart 5 can be found at our brand new support center.

Create an account to edit articles | See Formatting Syntax for Wiki syntax | We look forward to your contribution!

AJAX Waiting Message for Small Search Box

This article assumes you have already installed the optimized v3.5 search files.

1.) Open the file “pc/SmallSearchBox.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))
%>

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">

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" >

QR Code
QR Code AJAX Waiting Message for Small Search Box (generated for current page)