2 functions in onSubmit?

Discussion in 'JavaScript' started by jnm, Jun 3, 2006.

  1. #1
    how could you use 2 functions with onSubmit? i want to have form validation and the submit button text change on click. would it be like this:

    <form style="margin: 0;" method="POST" action="/process.php" name=signup onsubmit="return validateOnSubmit(), chtext()">
    Code (markup):
    is that how you use two functions in one declaration?
     
    jnm, Jun 3, 2006 IP
  2. mykoleary

    mykoleary Peon

    Messages:
    64
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #2
    run one onsubmit function. The validateOnSubmit() one. In it, call chtext(). That way if the validation fails, you can call chtext() again to change the text back to the original text. Also only gives you one onsubmit function.
     
    mykoleary, Jun 3, 2006 IP