Creating the Form
Note
Indexing Service is no longer supported as of Windows XP and is unavailable for use as of Windows 8. Instead, use Windows Search for client side search and Microsoft Search Server Express for server side search.
After you have set up the header, you are ready to create the .asp search form.
<TABLE>
<TR>
<TD><H1>Sample ASP Search Form</H1></TD>
</TR>
</TABLE>
<HR WIDTH=75% ALIGN=center SIZE=3>
<p>
<TABLE>
<TR>
<TD ALIGN=LEFT>Enter your query below:</TD>
</TR>
<TR>
<TD>
<FORM ACTION="<%= QueryForm%>" METHOD=POST>
<TABLE>
<TR>
<TD><INPUT TYPE="TEXT" NAME="SearchString" SIZE="60"
MAXLENGTH="100" VALUE="<%=SearchString%>"></TD>
<TD><INPUT TYPE="SUBMIT" NAME="Action" VALUE="New Query"></TD>
</TR>
</TABLE>
</FORM>
</TD>
</TR>
</TABLE>
The two most important lines are the FORM ACTION and the INPUT TYPE lines.
-
<FORM ACTION. . .>
-
This line names the current file, where the processing code is located.
-
<INPUT TYPE="TEXT". . .>
-
Here the variable SearchString is preset to accept whatever text is typed in the "Enter your query below" field. For example, if you type "cache" in this field, SearchString holds the text "cache".
-
<INPUT TYPE="SUBMIT". . .>
-
This line creates the button that executes your query. In this example, the button is called New Query.