|
|
Q291 In a form one with only one text field how can you ensure that the form is only submitted if the submit button has been pressed?
irt.org | Knowledge Base | JavaScript | Form 7.1 | Q291 [ previous next ] Q291 In a form one with only one text field how can you ensure that the form is only submitted if the submit button has been pressed?Its the opposite question to "How can I submit a form which has more than one text field by just pressing enter?" You can either add a another text field, or, you can trap the user pressing the enter key, rather than clicking the submit button by using a boolean flag:
You might want to reset the boolean falg after the form has been submitted, especially if submitting the form the client side processing:
Feedback on 'Q291 In a form one with only one text field how can you ensure that the form is only submitted if the submit button has been pressed?' |
-- div -->
|