I am using Jquery Validation Engine for validating scripts on my site. However, on submit the error message disappears. I have used the following script
$(document).ready(function(){
var use_ajax=true; var use_ajax2=true; $.validationEngine.settings={}; $("#contact-form").validationEngine({ promptPosition : "bottomLeft", success : function(){use_ajax=true}, failure : function(){use_ajax=false;} }); $("#contact-form").submit(function(e){ if(use_ajax) { $('#loading').css('visibility','visible'); $.post('mysubmitpage.php',$(this).serialize()+'&ajax=1', function(data){ $("#contact-form").hide('slow').after('<h1>Thank you!</h1>'); $('#loading').css('visibility','hidden'); } ); } e.preventDefault(); }) });
Where am I going wrong? I want the error message to stay. How can I troubleshoot as I am fairly new to JQuery.
use