• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

more than 1 function in cfform tag "onSubmit"

Participant ,
Sep 12, 2013 Sep 12, 2013

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

Views

1.5K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 20, 2013 Nov 20, 2013

Copy link to clipboard

Copied

LATEST

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation