PassMark Logo
Home » Forum

Announcement

Collapse
No announcement yet.

Search box & Javascript

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Search box & Javascript

    Hello,

    I would like to create a search box in the header of an existing page.

    I want to use a javascript platform.

    I have tried to add the following lines (from the serach.htm file):

    <script language="JavaScript" src="settings.js"></script>
    <script language="JavaScript" src="search.js"></script>
    <body onload="if (document.getElementById('zoom_searchbox')) {document.getElementById('zoom_searchbox').focus() ;}">
    <h1>Search this site</h1>
    <p>
    Enter one or more keywords to search for using the Zoom Search Engine.<br />
    Note that '*' and '?' wildcards are supported.
    </p>
    <!-- This is where the search form and results will appear -->
    <script language="JavaScript">ZoomSearch();</script>
    <noscript>You must have JavaScript enabled to use this version of the search engine.</noscript>
    </body>

    But it does not work


    Do you have an example?

    Thanks

    Didier

  • #2
    You are going about it wrong.
    You don't want to insert the entire search engine on every page. You just need a HTML form.

    See this FAQ
    Q. How do I add search boxes to my web pages?

    and if you want a fancy box, this FAQ
    Q. How do I create search forms with images for buttons, etc.?

    Comment


    • #3
      With a form

      With the following

      <form action="" method="post" name="Search">
      <script language="JavaScript" src="../english/search/settings.js"></script>
      <script language="JavaScript" src="../english/search/search.js"></script>
      <script language="JavaScript">ZoomSearch();</script>
      <input name="Search" type="button" value="Search" /></form>

      I have the field.
      I can enter my word.

      But nothing happens when I press the button.

      On the zoom search engine web site, I found many examples for PHP, ASP,... but not for javascript.

      Any ideas????

      Thanks for help

      Didier

      Comment


      • #4
        Any ideas????
        Yes, read the FAQ.
        Q. How do I add search boxes to my web pages?

        Quote, "JavaScript users will need to replace "search.php" with "search.html""

        Comment

        Working...
        X