Anonymous asked in Computers & InternetProgramming & Design · 1 decade ago

Form button only works when l click it, l need to work by pressing enter - how?

I have a form in a php document that allows for me to password protect a directory. However, when someone enters the password and presses "Enter" on the keyboard it reloads the same page but with extra url data in the address bar to include the password they have just typed in. How can l setup the form so that it works when someone presses enter on their keyboard?

2 Answers

  • 1 decade ago
    Favorite Answer

    It sounds like you have the form action set to the same page, and the method as GET.

    You either need change the page content to reflect submitted data, and if you set the form attribute method="post" then the submitted data will not be displayed in the URL.

    For more information try this tutorial:

  • 1 decade ago

    Try setting 'tabindex' values of the form elements.

Still have questions? Get your answers by asking now.