Click to See Complete Forum and Search --> : Help with form Submit


daveWho
04-11-2003, 11:14 AM
On a form, I need to be able to differentiate between someone hitting the "Enter" key, and someone clicking a submit button. This is to try to combat a natural inclination to hit Enter after filling in a textarea, and prematurely submitting the form.

I've tried manipulating this.value with various combinations of onClick and onKeypress, but no luck so far.

Is there any way this can be done?

Vladdy
04-11-2003, 11:20 AM
Keep in mind that some people do not use mouse and preventing form submission by disabling "Enter" key will make your form inaccessible.
Your best choice is to simply verify that upon form submission each field has a value, regardless whether the form was submitted with "Enter" key or by clicking on "Submit" button.

PeOfEo
04-11-2003, 11:25 AM
Well make sure you hotkey your submit button. I ddint think it did submit if the user was typing in a text area, I thought the defualt settings did not allow it, I have never seen it happen atleast. But I know I have made the revers so that when a user does hit enter it submits so I am sure their is a way to do the opposite, but this is something for the java script forum.