View Full Version : How to disable "ENTER" key from executing the form?

11-20-2010, 08:17 PM
how can I disable the "ENTER" key to execute the form to submitting?
If the user have some input boxes and if he/she push the "ENTER" key it should not execute the form, it should focus the next input box or should do nothing.

Is it possible with php or maybe with java?

Thanks a lot for any advice.

11-20-2010, 08:25 PM
replace submit with button:

<input type="button" value="Submit" onclick="this.form.submit()" />

11-20-2010, 08:36 PM
Thank you.
This solved my problem.

Thank you for your time.

11-20-2010, 09:52 PM
To be clear, this is neither PHP or Java, but Javascript. People confuse Java and Javascript a lot, but they are very different, the former being a scripting language.