What fires the submit action of a form without a submit button 
Author Message
 What fires the submit action of a form without a submit button

I have a form that does not have a submit button on it.  It has only
three radio buttons a input text box and a button.  The button is so
that I can do a verification and then fire the submit event.  My
problem is that if the user hits enter in the text box, the form gets
submitted.

Sent via Deja.com http://www.*-*-*.com/
Before you buy.



Fri, 24 Jan 2003 03:00:00 GMT  
 What fires the submit action of a form without a submit button
Why not do the verification in the form's onsubmit handler and cancel the
submit if there's an error?

  <form onsubmit="return checkit()">
    ...
  </form>
  <script>
  function checkit() {
    if (there's an error) return false;
    else return true;
  }
  </script>

=-=-=
Steve
-=-=-


Quote:
> I have a form that does not have a submit button on it.  It has only
> three radio buttons a input text box and a button.  The button is so
> that I can do a verification and then fire the submit event.  My
> problem is that if the user hits enter in the text box, the form gets
> submitted.

> Sent via Deja.com http://www.deja.com/
> Before you buy.



Fri, 24 Jan 2003 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Submitting Form WITHOUT Submit Button

2. Submitting form without submit button...

3. Submitting Form WITHOUT a Submit Button

4. Submitting form without submit button...

5. submit without submit button

6. Pass values from FORM fields to another page without a SUBMIT action

7. form action on the submit button

8. SUBMIT form with 3 different submit buttons - error

9. form submits hrefs images and submit buttons

10. form submit using different submit buttons

11. SUBMIT form with 3 different submit buttons - error

12. Form entry without the use of the submit button

 

 
Powered by phpBB® Forum Software