This is what I have so far:

        $("#submitForm").validate({
                rules: {
                        address: {
                                required: true,
                                email: true,
                                remote: "script/validateEmail.php"
                        },
                        password: {
                                required: true,
                                rangelength: [6, 12]
                        },
                        date: {
                                required: true,
                                date: true
                        },
                        zipcode: {
                                required: true,
                                digits: true,
                                rangelength: [5, 5],
                                remote: "script/validateZip.php"
                        },
                        asfield: {
                                required: true,
                                rangelength: [3, 3],
                                remote: "script/validateASF.php"
                        }
                },
                messages: {
                        address: {
                                required: "",
                                email: true,
                                remote: "  Not Available"
                        },
                        password: {
                                required: "",
                                rangelength: ""
                        },
                        date: {
                                required: "",
                                date: ""
                        },
                        zipcode: {
                                required: "",
                                digits: "",
                                rangelength: "",
                                remote: "  Zipcode Invalid"
                        },
                        asfield: {
                                required: "  moo?",
                                rangelength: "",
                                remote: "  moo?"
                        }
                },
                submitHandler: function(form) {
                        jQuery(form).ajaxSubmit();
                }

        });

The form is verified correctly and the AJAX submit works correctly. I
tried putting the callback function within the jQuery(form).ajaxSubmit
() function but things weren't working correctly... The after submit
code works correctly but I just don't know where to put it. Forgive me
if this is an easy question but I haven't had time to get a book to
properly come up to speed on JS yet. This is what I am looking to run:

$("#submitForm").ajaxForm(function() {
        $.blockUI({ message: '<h1>Creating Account...<br /><br /><img
src="../images/ajax-loader.gif" /></h1>' });

        setTimeout($.unblockUI, 4000);
});

This code is currently outside of the validation code and does not
work as intended. The script will fired when the user just presses the
submit button and no validation has taken place.

Thanks

Reply via email to