Second Sighting Logo

Calling Multiple JavaScript Functions onSubmit

Posted in JavaScript by Tom on the December 8th, 2011

Use the following syntax:

onSubmit="return (FunctionOne() && FunctionTwo() && FunctionThree());"

This will ensure all functions are run when the button is clicked. If you use the format

onSubmit="return FunctionOne(); return FunctionTwo(); return FunctionThree();"

then only the first function is run.