4 Replies Latest reply: Oct 25, 2012 2:24 AM by BKBK RSS

    jquery validation engine and CF issue.

    cfsetNewbie Community Member


      I'm working on a simple coldfusion contact form. I am trying to use a jquery plug - in with it, I have the plug in working with no problem, but it won't reload the page to allow the coldfusion to execute if all fields are valid. I'm posting my code.. can anyone help me? I think I need to add a call for the page to reload with the variables to my script.. not sure how I do that.

      <link rel="stylesheet" href="scripts/validationEngine.jquery.css" type="text/css"/>

      <script src="scripts/jquery-1.7.2.min.js" type="text/javascript" charset="utf-8"></script>

      <script src="scripts/jquery.validationEngine-en.js" type="text/javascript" charset="utf-8"></script>

      <script src="scripts/jquery.validationEngine.js" type="text/javascript" charset="utf-8"></script>



              function beforeCall(form, options){

                  if (window.console)

                  console.log("Right before the AJAX form validation call");

                  return true;



              // Called once the server replies to the ajax form validation request

              function ajaxValidationCallback(status, form, json, options){

                  if (window.console)



                  if (status === true) {

                      alert("the form is valid!");

                      // uncomment these lines to submit the form to form.action



                      // or you may use AJAX again to submit the data






                      ajaxFormValidation: true,

                      onAjaxFormComplete: ajaxValidationCallback,





      and here is what sets off the coldfusion, it's all on the same page, one page mailing it and so on..


      <cfset arrErrors = ArrayNew( 1 ) >

      <cfset showForm = true>


      <cfif structKeyExists(form, "sendcomments")>

      <!--- Create an empty error string --->



      <!--- we are inserting a new record --->

      <cfif NOT ArrayLen( arrErrors )>



      <!--- code for cfmail goes here ----->



      <cfform id="formID" action="#cgi.script_name#" method="post" enctype="application/x-www-form-urlencoded">

      <!--- form items --->


      thank you bla bla bla


      that's it without getting into the form and all of that. I have the validation working, not able to send the message. I know it's because ajax/jquery aren't reloading the page, how do I make it do that?


      Thank you!