Support » Fixing WordPress » Search button doesn't work in Firefox

  • Resolved relaysignal

    (@relaysignal)


    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>
Viewing 10 replies - 1 through 10 (of 10 total)
  • esmi

    (@esmi)

    Forum Moderator

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

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

    @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/

    esmi

    (@esmi)

    Forum Moderator

    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>

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

    esmi

    (@esmi)

    Forum Moderator

    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).

    @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.

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

    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>

    Great! That fixed it up! Thanks!

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Search button doesn't work in Firefox’ is closed to new replies.