Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Oct 2005
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How to excecute 2 different form validation Java scrpt with 1 submit button ?

    Hi,

    how do I execute 2 scripts with 1 submit button??

    for example I have 2 separate scripts, one for checking that the required fields of a form is entered and another for making sure an important field within your form is filled out correctly.

    Both scripts require me to enter this
    onSubmit="return formCheck(this)"
    onSubmit= "return verify(this.password1, this.password2)"

    how do I combine these two together? I have tried these syntax

    <form name="suppliersregistrationform" onSubmit="return (formCheck(this),verify(this.password1, this.password2))" >

    <form name="suppliersregistrationform" onSubmit="return (formCheck(this)" onSubmit= "return verify(this.password1, this.password2)">

    But none of these syntax worked... pls advise.

    I would really appreciate any help on this.. thank you very much.

  • #2
    Regular Coder
    Join Date
    Nov 2003
    Location
    Vancouver Island Canada
    Posts
    139
    Thanks
    0
    Thanked 0 Times in 0 Posts
    onsubmit = "formCheck(this); verify(this.password1, this.password2)"

  • #3
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,465
    Thanks
    0
    Thanked 634 Times in 624 Posts
    onSubmit="return formCheck(this)?verify(this.password1, this.password2):false"
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.


  •  

    Posting Permissions

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