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
(< and >) may appear as escaped HTML code (< and >). 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.
1. | In FrontPage, open a server-based web. |
2. | Create a new search page:
In FrontPage 2000:
a. | On the File menu, point to New, and then click Page. | b. | Click the General tab. Click the Search Page icon and then click OK. | In FrontPage 2002:a. | On the File menu, point to New, then click Page or Web. | b. | On the New Page or Web task pane, click Page Templates. | c. | Click the Search Page icon and then click OK. |
|
3. | Switch to HTML view and add the following DHTML code in the
<HEAD></HEAD> section of the page:
<script language="vbscript" for="window" event="onLoad">
<!--
' Loop through all HTML tags on the page.
For x = 0 to document.all.length -1
' Is this an INPUT tag?
If document.all(x).tagName = "INPUT" Then
' Is it the RESET button?
If (document.all(x).type = "reset") Then
' Create a new button named CLEAR.
strButton = "<input type=button name=cmdClear value=Clear>"
' Show the new RESET button after the SUBMIT button
document.all(x).insertAdjacentHTML "AfterEnd",strButton
End If
End If
Next
-->
</script>
|
4. | 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="vbscript" for="cmdClear" event="onClick">
<!--
' Clear the search form when the CLEAR button is clicked.
document.all("UserRestriction").value = ""
-->
</script>
If you are using the built-in FrontPage WAIS searching:
<script language="vbscript" for="cmdClear" event="onClick">
<!--
' Clear the search form when the CLEAR button is clicked.
document.all("search").value = ""
-->
</script>
|
5. | Switch back to Normal view and save the page to your web
site. |
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.