Microsoft KB Archive/300467

= How to add a clear function to the built-in search page by using DHTML in FrontPage 2002 =

Article ID: 300467

Article Last Modified on 1/31/2007

-

APPLIES TO


 * Microsoft FrontPage 2000 Standard Edition
 * Microsoft FrontPage 2002 Standard Edition

-



This article was previously published under Q300467



SUMMARY
In Microsoft FrontPage, the built-in search page includes a form with Submit and Reset buttons. It does not contain a Clear button to clear the form fields. This article explains how to use Dynamic HTML (DHTML) code to add a Clear button to the search results page.

NOTE: The examples presented in this article use custom DHTML that may not be available in all browsers. For more information about compatibility with other browsers, click Microsoft FrontPage Help on the Help menu, type compatibility in the Office Assistant or the Answer Wizard, and then click Search to view the topic.



MORE INFORMATION
Microsoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements. NOTE: You may receive an error message if you copy the examples directly from this article and paste them into FrontPage. The angle brackets may appear as escaped HTML code. To work around this behavior, paste the script into a blank Notepad document, and then copy it from Notepad before you paste it into FrontPage.  In FrontPage, open a server-based web. Create a new search page:

In FrontPage 2000:

 On the File menu, point to New, and then click Page. Click the General tab. Click the Search Page icon and then click OK.

In FrontPage 2002:  On the File menu, point to New, then click Page or Web. On the New Page or Web task pane, click Page Templates.</li> Click the Search Page icon and then click OK.</li></ol> </li>  Switch to HTML view and add the following DHTML code in the <HEAD></HEAD> section of the page: <script language=&quot;vbscript&quot; for=&quot;window&quot; event=&quot;onLoad&quot;> </li>  Add the following additional DHTML code in the <HEAD></HEAD> section of the page. Use the appropriate code for your search configuration:

If you are using Index Server or Indexing Services and IIS: <script language=&quot;vbscript&quot; for=&quot;cmdClear&quot; event=&quot;onClick&quot;> If you are using the built-in FrontPage WAIS searching: <script language=&quot;vbscript&quot; for=&quot;cmdClear&quot; event=&quot;onClick&quot;> </li> Switch back to Normal view and save the page to your web site.</li></ol>

In Microsoft Internet Explorer, when you submit a search and click the Clear button on the search results page, the form fields will be cleared.

<div class="references_section">