Search code examples
javascriptcoldfusion

JavaScript on Form Submit


I am submitting a ColdFusion Form and I want to run some JavaScript to check field validation before I run my ColdFusion code to process the form as needed.

How can I do this? What do I do in JS to call my .cfm file after the form passes validation?

Thanks!

-Jason


Solution

  • You need

    <form name="myform" action="myserverscript.cfm" onsubmit="return validate()">
    

    if you return true the form submits, false it doesn't