I see you have a typo  and wrong id?

$("#commentform form").submit(function(){
                var uname = $("#commenter").val();

                                        ^^^^^^ wrong id?

                var email = $('#email').val();
                var url = $('#website').val();
                var commment = $('#commenter').val();

                ^^^^^ one too many m?

--
HLS

atomicnuke wrote:
> I have the following function, it gets the data in a form and sends it
> to be verified before posting.
>
> $("#commentform form").submit(function(){
>               var uname = $("#commenter").val();
>               var email = $('#email').val();
>               var url = $('#website').val();
>               var commment = $('#commenter').val();
>               $.ajax({
>                       type: "POST",
>                       url: "../../../testingphase/blog/commenttest.php",
>                       dataType: "html",
>                       data: "commenter="+escape(uname)+'&email='+escape(email)
> +"&website="+escape(url)+"&comment="+escape(comment),
>                       success: function(msg) {
>                               if(msg == 0)
>                               { $('#errormess').html(msg); }
>                               else { alert('Wow');}
>                       }
>               });
>               return false;
>       });
>
> First I just set the variables and showed them in an alert to make
> sure I was targeting them. Then I added the ajax and on submit it just
> processes with php. I did the ajax just like my other post and get,
> but can't see why this one doesn't work.

Reply via email to