Search works in FF but not IE ?

Discussion in 'PHP' started by crazyryan, Feb 22, 2008.

  1. #1
    Ignore, just remembered IE doesnt like hitting return for forms.
     
    crazyryan, Feb 22, 2008 IP
  2. LittleJonSupportSite

    LittleJonSupportSite Peon

    Messages:
    386
    Likes Received:
    20
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Well a fix for that is to give the search box a name and value and have you search function have it watch.

    Example:

    
    <?php
    
    if ($submitted) {
    // run search func
    echo "you hit enter and I fired, don't lie.. you know you hit it!";
    }
    ?>
    <form method="post">
    <input type="submit" name="submitted" value="Submit me!">
    </form>
    
    Code (markup):
     
    LittleJonSupportSite, Feb 22, 2008 IP
  3. NathanH

    NathanH Peon

    Messages:
    39
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    LittleJonSupportSite, not a good way to do it at all.
    Easiest way is to make it work in IE is to have a hidden field.

    
    <input name="search" type="hidden"><input name="search_term" type="text">
    
    Code (markup):
    Then in PHP

    
    if ( isset($_POST['search']) )
    {
        // Blah
    }
    
    PHP:
     
    NathanH, Feb 22, 2008 IP
  4. crazyryan

    crazyryan Well-Known Member

    Messages:
    3,087
    Likes Received:
    165
    Best Answers:
    0
    Trophy Points:
    175
    #4
    Yeah, I ended up using NathanH's suggestion after someone else also told me about it. Thanks
     
    crazyryan, Feb 23, 2008 IP