2 text fields submitted only on click?

Results 1 to 2 of 2

Thread: 2 text fields submitted only on click?

  1. #1
    Joseph L Guest

    Default 2 text fields submitted only on click?

    In a form one with more than one text field how can you ensure that the form is only submitted if the submit button has been pressed?<BR><BR>http://www.irt.org is close to answering it but they dont really address this.

  2. #2
    Join Date
    Dec 1969

    Default One easy way...

    Do *NOT* put a SUBMIT button in your form!<BR><BR>Instead, do this:<BR><BR>&#060;INPUT Type=Button Value="Push to submit"<BR>&nbsp; &nbsp; &nbsp; onClick="if ( validate(this.form) ) this.form.submit();"&#062;<BR><BR>See it? You can still use your validate function to ensure both fields are filled in. And by using a Type=button instead of Type=Submit, hitting ENTER will *never* automatically submit the form.<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts