How to get Jquery form plugin and Jquery validation to work together.

Posted by Matthew on Stack Overflow See other posts from Stack Overflow or by Matthew
Published on 2010-06-17T15:24:38Z Indexed on 2010/06/17 16:43 UTC
Read the original article Hit count: 329

Hello guys,

I was hoping someone can shed some light on what might be occurring on my page.

Okay what I currently have on my page is a simple form that collects first name, last name, city, state and email.

Once submitted it will hit a PHP page that updates our DB and echo's back to the designted div with a class of .response.

I am using jquery.validation and placing that dynamic function within the submitHandler like so:

submitHandler: function(form) {
    $(form).ajaxSubmit({
        target:        '.response',   // target element(s) to be updated with server response
        resetForm: true,
        success: function() {
            $('#commentform').hide();
            $('.response').show();
        }
    });

So what I am getting is a div that is not being populated with the echo from my php file in FF and in IE I am getting the message of thank you but the page is taking me to the update.php script in which I have the form action pointing to.

I am not sure what I am missing...

Thanks,

Matt

© Stack Overflow or respective owner

Related posts about php

Related posts about jQuery