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
-
1Can we see your code? Are there any hidden issues that make it non-trivial in your case?John Dvorak– John Dvorak2013年04月09日 05:11:47 +00:00Commented Apr 9, 2013 at 5:11
-
Nothing plus nothing is... well, nothing. Show me the code!RobG– RobG2013年04月09日 05:22:44 +00:00Commented Apr 9, 2013 at 5:22
1 Answer 1
Call the second function from within the first:
function checkForm()
{
// Your validation logic here
if (valid)
doRedirect();
}
answered Apr 9, 2013 at 5:11
Mark Parnell
9,2109 gold badges33 silver badges37 bronze badges
Sign up to request clarification or add additional context in comments.
Comments
Explore related questions
See similar questions with these tags.
lang-js