WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Search button doesn't work in Firefox (11 posts)

  1. relaysignal
    Member
    Posted 3 years ago #

    In what seems to be a strange 'bug' my search button won't work in Firefox or Chrome, but works just fine in Safari. In Firefox and Chrome, clicking the "Search" button doesn't do anything, it doesn't take you to another page or anything.
    Here's my search form code:

    <form action="<?php bloginfo('home'); ?>/" method="get" id="search-form">
    <div style="float:right;margin-right:-15px;margin-top:7px;">
    <input type="text" value="" class="textfield" name="s" id="s" />
    <input type="submit" value="SEARCH" class="button search-button" />
    </div>
    </form>
  2. esmi
    Forum Moderator
    Posted 3 years ago #

    Unless you provide a link to a page demonstrating the problem, no one will be able to offer much in the way of assistance.

  3. Curtiss Grymala
    Member
    Posted 3 years ago #

    Is it just the button that doesn't work, or does pressing "Enter" while your cursor is in the search box do nothing, too?

  4. relaysignal
    Member
    Posted 3 years ago #

    @Curtiss: Both clicking the button and pressing enter don't work in Firefox and Chrome.

    @Esmi: Ha, sorry about that! The link to the site is http://www.uatrav.com/

  5. esmi
    Forum Moderator
    Posted 3 years ago #

    Your form markup is malformed on your site.

    <div method="get" action="http://www.uatrav.com/" <form="" class="mainmenu" id="menucolor">
    <div style="float:right;margin-right:-15px;margin-top:7px;">
    <input type="text" id="s" name="s" class="textfield" value="">
    <input type="submit" class="button search-button" value="SEARCH">
    </div>
  6. relaysignal
    Member
    Posted 3 years ago #

    Any idea why the code would malform when viewed in certain browsers like that?

  7. esmi
    Forum Moderator
    Posted 3 years ago #

    Presumably it hinges upon how it is being added to the theme/page. Have you tried deactivating all plugins to see if this resolves the problem. If this works, re-activate the plugins one by one until you find the problematic plugin(s).

  8. Curtiss Grymala
    Member
    Posted 3 years ago #

    @relaysignal - It's not that the form markup is only malformed in Firefox. The code is wrong, no matter which browser you're using. However, each browser has its own way of trying to interpret and fix incorrect code. It just so happens that the Firefox and Chrome methods of trying to interpret that code failed; while the Safari method worked.

  9. relaysignal
    Member
    Posted 3 years ago #

    Fair enough, but what is wrong with the code? I've tried several different search for codes to no avail...

  10. Curtiss Grymala
    Member
    Posted 3 years ago #

    This is the code I am seeing on your page:

    <div class="whitebg"> <!-- Start WhiteBG -->
    <div id="menucolor"  class="mainmenu"
     class="mainmenu"
    <form action="http://www.uatrav.com/" method="get" id="search-form">
    <div style="float:right;margin-right:-15px;margin-top:7px;">
    <input type="text" value="" class="textfield" name="s" id="s" />
    <input type="submit" value="SEARCH" class="button search-button" />
    </div>
    </form>

    It looks like you've got an extra class="mainmenu" instead of a closing bracket for the div with an ID of menucolor.

    Try to see if you can find that code and change it to:

    <div class="whitebg"> <!-- Start WhiteBG -->
    <div id="menucolor"  class="mainmenu">
    <form action="http://www.uatrav.com/" method="get" id="search-form">
    <div style="float:right;margin-right:-15px;margin-top:7px;">
    <input type="text" value="" class="textfield" name="s" id="s" />
    <input type="submit" value="SEARCH" class="button search-button" />
    </div>
    </form>
  11. relaysignal
    Member
    Posted 3 years ago #

    Great! That fixed it up! Thanks!

Topic Closed

This topic has been closed to new replies.

About this Topic