1

I have an email form validation script. If this first function returns true (no errors in email field), then the second function will execute, which is simply a url redirect. Can someone combine these two functions, so that all I need to put in the the form is something like, onsubmit="return checkForm();"

Prasath K
5,0287 gold badges26 silver badges35 bronze badges
asked Apr 9, 2013 at 5:09
2
  • 1
    Can we see your code? Are there any hidden issues that make it non-trivial in your case? Commented Apr 9, 2013 at 5:11
  • Nothing plus nothing is... well, nothing. Show me the code! Commented Apr 9, 2013 at 5:22

1 Answer 1

2

Call the second function from within the first:

function checkForm()
{
 // Your validation logic here
 if (valid)
 doRedirect();
}
answered Apr 9, 2013 at 5:11
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.