Return to Snippet

Revision: 43993
at April 4, 2011 23:20 by marzsman


Initial Code
$(document).ready(function(){
	var f = $("#signup_form").validate({
         rules: {
             firstname: "required",
             lastname: "required",
             email: {
               required: true,
               email: true
             },
             comment: {
               maxlength: 200 
             }
           },
		submitHandler: function(form) {
			$("#signup").ajaxSubmit({
                success: showResponse
			});
		  return false;
		}
	});
	function showResponse(responseText, statusText, xhr, $form) {
        f.resetForm();
        $('.msg').html('Thank you, your message was successfully sent');
    }
});

Initial URL

                                

Initial Description
Valiodate a form with jQuery.Validate and submit it with jQuery.form

Initial Title
Validate + submit form

Initial Tags
javascript, html, jquery

Initial Language
jQuery