www.webdeveloper.com
Results 1 to 5 of 5

Thread: Simple Search Not working in Firefox

  1. #1
    Join Date
    May 2007
    Posts
    2

    Question Simple Search Not working in Firefox

    Greetings,
    The following works well with IE but not in FF. By clicking the OK button or pressing the Enter key, nothing happens.

    The function:
    PHP Code:
    function search(querystring) {
     
    addr "http://www.mediaradio.info/cgi-bin/nk.cgi?" querystring "-search" "-1";  
     
    top.location.href addr;

    Its use:
    PHP Code:
    <input type="text" name="query" size=14 maxlength=32 class=select1>&nbsp;
    <
    input type ="image" name="cmdSearch" SRC="http://picasso.mediaradio.ca/ok2.gif" onClick="search(query.value)"
    Thanks!

  2. #2
    Join Date
    May 2004
    Location
    FL
    Posts
    3,447
    Try this:

    <input type ="image" name="cmdSearch" SRC="http://picasso.mediaradio.ca/ok2.gif" onClick="search(query.value) return false;">
    Lee

    ""Men occasionally stumble over the truth, but most of them pick themselves up and hurry off as if nothing ever happened."" -- Sir Winston Churchill

  3. #3
    Join Date
    Dec 2005
    Location
    FL
    Posts
    7,356
    Either way seems to work with a slight modificaton:
    PHP Code:
    <html>
    <
    head>
    <
    title>Search Site</title>
    <
    script type="text/javascript">
    function 
    search(querystring) {
      
    addr "http://www.mediaradio.info/cgi-bin/nk.cgi?" querystring "-search" "-1";  
      
    top.location.href addr;

    </script>
    </head>
    <body>


    <input type ="image" name="cmdSearch" SRC="http://picasso.mediaradio.ca/ok2.gif"
     onClick="search(document.getElementById('query').value)"> 

    <input type="text" id="query" name="query" size=14 maxlength=32 class=select1 value="">&nbsp;

    <input type ="image" name="cmdSearch" SRC="http://picasso.mediaradio.ca/ok2.gif"
     onClick="search(document.getElementById('query').value);return false">
    </body>
    </html> 

  4. #4
    Join Date
    May 2007
    Posts
    2

    Talking

    It works! Many thanks JMRKER!

  5. #5
    Join Date
    Dec 2005
    Location
    FL
    Posts
    7,356
    You're most welcome.
    Glad I could help.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles