Copy link to clipboard
Copied
i need to call atleast 3 javascript functions in a form
using "onSubmit" works fine with one function but when i try to add another nothing happens....
<cfform
action="postpage.cfm" method="POST"
target="_self"
onsubmit="if(document.getElementById('Agree').checked) { return true; } else { alert('You must agree to the Terms and Conditions'); return false; }">
"return checkEmail(this);" is one of the funtions. it checks to see if 2 cfinputs are the same
how do i add multiple functions to onSubmit
tnx in advance
Copy link to clipboard
Copied
ColdFusion is simply behaving as it should. You will notice that the script that currently runs upon onSubmit ends in a return-statement. That signals the end of the event-handler.
If you wish to check the e-mail as well, you could run one script that performs both functions. I was thinking of something like the following, just off the cuff
onsubmit="if(!document.getElementById('Agree').checked) {alert('You must agree to the Terms and Conditions'); return false; } else {return checkEmail(this);}">