[jQuery] jQuery Success on form submit not working?
Hi all -
I cannot seem to get this success piece to work, the script will go
through and validate each field of my contact form and prompt the user
to enter in required data etc... Hit the submit button and I get my
email notification however; the success function does not display.
Anyone know why?
Js.setup.util.editable({title: "Key in the custom value"});
var contactBox = window.contactBox = {
contact: {
task: function() {
var node = jQuery("#contact_type");
var child = jQuery("#show-if-corporate");
var task = function() {
if (node.val() == "Corporate") {
child.slideDown();
}
else {
child.slideUp();
}
};
node.bind("change", function() {
task();
});
task();
},
success: function(text) {
jQuery("#contact-form").slideUp();
jQuery("<h3/>").text("Thank You").appendTo("#col_670");
jQuery("<p/>").text("I will get back to you shortly.").appendTo
("#col_670");
}
}
}
jQuery(function() {
new Js.util.editable("#contact_subject");
new Js.util.editable("#contact_task");
new Js.util.editable("#contact_type");
new Js.util.editable("#contact_budget", {
prefix: "$ "
});
contactBox.contact.task();
new Js.util.formSubmit({
id: "#contact-form",
url: "contact_me.php",
option: {
onError: function(){
alert("Please fill in all required fields (marked by *)");
}
}
});
});