• For some reason plugin is not preventDefault submit action and is still redirecting to default wordpress error page. I thought this plugin will do jquery-validate validation or something similar, which will prevent default submission. I wrote a jquery validate script. Which helps me do what I want, I think you plugin should do it too. ??

    
    jQuery(function($) {
    	var Container = $("<div class='error'>Please fill all the required fields</div>").appendTo("#commentform").hide();
    	var LabelContainer = $("<div class='error errorlabels'></div>").appendTo("#commentform").hide();
    	$("#commentform").validate({
    		rules: {
    			author: "required",
    			email: {
    				required: true,
    				email: true
    			},
    			url: "url",
    			comment: "required"
    		},
    		Container: Container,
    		LabelContainer: LabelContainer,
    		ignore: ":hidden",
    	    submitHandler: function(form) {
              $(form).ajaxSubmit();
            },
            onsubmit: true
    	});
    	$.validator.messages.required = "";
    	$.validator.messages.email = "&raquo; " + $.validator.messages.email;
    	$.validator.messages.url = "&raquo; " + $.validator.messages.url;
    });
    
  • The topic ‘Broken ajax validation’ is closed to new replies.