Hi all, I'm using this jQuery Validation script to submit my form(s), but I need some help tweaking it to display the message, and to show the form again (after submitting)
http://www.position-absolute.com/articles/jquery-form-validator-because-form-validation-is-a-mess/
^^ The Code
http://www.position-relative.net/creation/formValidator/demoSubmit.html
^^ The Demo
If you look at the demo, I'd like it to display the green message and also display the form again (rather than hiding it).. I can't seem to figure out where in the script to change it.. here's the snippet of the JS code which does the ajax submit function:
submitForm: function (caller) {
if ($.validationEngine.settings.ajaxSubmit) {
$.ajax({
type: "POST",
url: $.validationEngine.settings.ajaxSubmitFile,
async: true,
data: $(caller).serialize(),
beforeSend: function () {
},
success: function (data) {
if (data == "true") { // EVERYTING IS FINE, SHOW SUCCESS MESSAGE
$(caller).css("opacity", 1)
$(caller).animate({
opacity: 0,
height: 0
},
function () {
$(caller).css("display", "none")
$(caller).before("<div class='ajaxSubmit'>" + $.validationEngine.settings.ajaxSubmitMessage + "</div>")
$.validationEngine.closePrompt(".formError", true)
$(".ajaxSubmit").show("slow")
if ($.validationEngine.settings.success) { // AJAX SUCCESS, STOP THE LOCATION UPDATE
$.validationEngine.settings.success && $.validationEngine.settings.success();
return false;
}
})
} else { // HOUSTON WE GOT A PROBLEM (SOMETING IS NOT VALIDATING)
data = eval("(" + data + ")");
errorNumber = data.jsonValidateReturn.length
for (index = 0; index < errorNumber; index++) {
fieldId = data.jsonValidateReturn[index][0];
promptError = data.jsonValidateReturn[index][1];
type = data.jsonValidateReturn[index][2];
$.validationEngine.buildPrompt(fieldId, promptError, type);
}
}
}
})
return true;
}
if ($.validationEngine.settings.success) { // AJAX SUCCESS, STOP THE LOCATION UPDATE
$.validationEngine.settings.success && $.validationEngine.settings.success();
return true;
}
return false;
},