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();"

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();
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

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.