Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End [Solved] Form works on ‘enter’, not on ‘click’ – Help?

  • This topic is empty.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #32894
    StephBertha
    Participant

    Hi there,

    I have this form, so when you type in a certain phrase, it will take you somewhere based on that phrase, but… it only works if I hit Enter on my keyboard. I’d like to work when you click the Submit button as well.

    Anybody have any ideas?

    
    
    // Portal Password
    if (isset($_POST))
    switch($_POST)
    {
    case "pass1":
    header("Location: http://www.google.com/");
    exit();

    case "pass2":
    header("Location: http://www.yahoo.com/");
    exit();

    default:
    header("Location: http://www.404.com/");
    exit();
    }
    }

    ?>





    Form













    #75173
    TT_Mark
    Member

    Input type=”submit” not button :-)

    #75174
    Avalonmel
    Participant

    Try using type=”submit” instead of “button”, otherwise the form doesn’t know what it’s supposed to do when you click it.

    #75175
    jcoder
    Member

    How about if type was an image, how would you go about this type=”image”

    #75177
    StephBertha
    Participant

    THAT WORKED! Yay!

    I’ve been examining the thing forever, and a little text change, and it fixed it. Thank youuuu :)

Viewing 5 posts - 1 through 5 (of 5 total)
  • The forum ‘Back End’ is closed to new topics and replies.