jquery validation engine and CF issue.
hello;
i'm working on simple coldfusion contact form. trying use jquery plug - in it, have plug in working no problem, won't reload page allow coldfusion execute if fields valid. i'm posting code.. can me? think need add call page reload variables script.. not sure how 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>
<script>
function beforecall(form, options){
if (window.console)
console.log("right before ajax form validation call");
return true;
}
// called once server replies ajax form validation request
function ajaxvalidationcallback(status, form, json, options){
if (window.console)
console.log(status);
if (status === true) {
alert("the form valid!");
// uncomment these lines submit form form.action
form.validationengine('detach');
form.submit();
// or may use ajax again submit data
}
}
jquery(document).ready(function(){
jquery("#formid").validationengine({
ajaxformvalidation: true,
onajaxformcomplete: ajaxvalidationcallback,
});
});
</script
and here sets off coldfusion, it's on same page, 1 page mailing , on..
| <cfset arrerrors = arraynew( 1 ) > |
<cfset showform = true>
<cfif structkeyexists(form, "sendcomments")>
<!--- create empty error string --->
<!--- inserting new record --->
<cfif not arraylen( arrerrors )>
<cfmail............
<!--- code cfmail goes here ----->
<cfoutput>
<cfform id="formid" action="#cgi.script_name#" method="post" enctype="application/x-www-form-urlencoded">
<!--- form items --->
</cfform>
<cfelse>
thank bla bla bla
</cfif>
that's without getting form , of that. have validation working, not able send message. know it's because ajax/jquery aren't reloading page, how make that?
thank you!
have gotten working?
More discussions in ColdFusion Rich Forms
adobe
Comments
Post a Comment