Results 1 to 3 of 3
  1. #1

    How to duplicate the same Java Script code.

    Hi, Im trying to duplicate a search option on a page on my website..

    here is and example of the code

    <script language="JavaScript">
    function dosearch() {
    var sf=document.searchform;
    var submitto = sf.sengines.options[sf.sengines.selectedIndex].value + escape(sf.searchterms.value);;
    return false;

    <form name="searchform" onSubmit="return dosearch();">
    <select name="sengines">
    <option value="" selected>Google</option>

    <input type="text" name="searchterms">
    <input type="submit" name="SearchSubmit" value="Search it!">

    Now my question is, when i add this code to my site as is, it works. but if i try to add the same code again but say to search Wilkipedi, the forms show up for both, but search doesn't work. Im trying to keep them seaprate, hence the separate code. Does anyone know how to make it work so i can keep adding the same code with different forms?

    thanks in advance.

  2. #2
    Administrator Dave's Avatar
    Join Date
    Sep 2004
    Te Awamutu, New Zealand
    Blog Entries
    Have you renamed the forms and JS functions? If you could post the URL it would help identify the problem.
    Dave Owen

  3. #3
    thank you.. renaming worked..


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Subscribe to us on YouTube