...

View Full Version : Resolved Jquery ajax form help (:



diload
10-15-2009, 04:17 PM
EDIT: Nevermind got it fixed(:

Hello i got a piece of code here in jQuery:


$("#cht").submit(function() {

var besked = $("#text").val();

$.ajax({
type: "POST",
async: false,
url: "./_libs/chat.php",
data: "msg=sendmsg&sender=testsender&modtager=ligemeget&besked="+besked,
success: function(data){
alert(data); // Only for Debugging
}
});


});

And i can't get the form to stop refreshing the site everytime i submit it
i tried both return false; and event.preventDefault(); and no one of them worked for me :( so any help would be appreciated thanks (:


Regards



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum