hmmm Im getting nowhere with this :/

So following the code on the page you suggested and the notes made
about .ajaxSubmit I transpose it like thus but nothing happens, it
does not even call the referenced thanks.php.

jQuery(function(){

        var options = {
                        type: "POST",
                        url: "thanks.php",
                        success: function() {
                                $('#contact_form').html("<div 
id='message'></div>");
                                $('#message').html("<h2>Contact Form 
Submitted!</h2>")
                          .append("<p>We will be in touch soon.</p>")
                          .hide()
                          .fadeIn(1500, function() {
                                  $('#message').append("<img id='checkmark' 
src='/images/
check.png' />");
                          });
                        }
                };


        jQuery("#myform").validate({
                submitHandler: function(myform) {
                                // inside event callbacks 'this' is the DOM 
element so we first
                                // wrap it in a jQuery object and then invoke 
ajaxSubmit
                                jQuery(myform).ajaxSubmit(options);
                }
        });
});

On Sep 16, 11:52 am, Jörn Zaefferer <joern.zaeffe...@googlemail.com>
wrote:
> Here is an 
> example:http://jquery.bassistance.de/validate/demo/ajaxSubmit-intergration-de...
>
> Jörn
>
> On Wed, Sep 16, 2009 at 12:39 PM, HairyJim <james.d...@gmail.com> wrote:
>
> > Sorry, I have no idea where to use the .ajaxSubmit() option in the
> > code. What do I need to change to pass the data over to the processing
> > file?
>
> > Thanks
> > James
>
> > On Sep 16, 10:49 am, Jörn Zaefferer <joern.zaeffe...@googlemail.com>
> > wrote:
> >> You don't specify any data to submit in your ajax call. Use the data
> >> option, or better yet, the form's plugin ajaxSubmit method. It will
> >> handle the form serialization for you.
>
> >> Jörn
>
> >> On Wed, Sep 16, 2009 at 11:42 AM, HairyJim <james.d...@gmail.com> wrote:
>
> >> > Hi all,
>
> >> > I have this Jquery code, below, which I was hpoing would pass the data
> >> > from the form over to form processing script  but the problem I have
> >> > is that the success is returned but the processing script does not
> >> > seem to get the form data passed to it.
>
> >> > I have tested the script is called by just firing a success email off.
> >> > What am I doing wrong, I'm lost in the forest and can't see the trees!
>
> >> > I am including jquery, jquery.validate and jquery.form
>
> >> > $(document).ready(function()
> >> > {
> >> >        $("#myform").validate({
> >> >                submitHandler: function() {
> >> >                        $.ajax({
> >> >                                type: "POST",
> >> >                                url: "thanks.php",
> >> >                                success: function() {
> >> >                                        $('#contact_form').html("<div 
> >> > id='message'></div>");
> >> >                                        $('#message').html("<h2>Contact 
> >> > Form Submitted!</h2>")
> >> >                                  .append("<p>We will be in touch 
> >> > soon.</p>")
> >> >                                  .hide()
> >> >                                  .fadeIn(1500, function() {
> >> >                                          $('#message').append("<img 
> >> > id='checkmark' src='/images/
> >> > check.png' />");
> >> >                                  });
> >> >                                }
> >> >                        });
> >> >                }
> >> >        });
> >> > });

Reply via email to