Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
  1. #1
    New Coder
    Join Date
    Apr 2009
    Location
    Denmark <'3
    Posts
    44
    Thanks
    5
    Thanked 1 Time in 1 Post

    Question Jquery ajax form help (:

    EDIT: Nevermind got it fixed(:

    Hello i got a piece of code here in jQuery:

    Code:
    $("#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
    Last edited by diload; 10-15-2009 at 04:23 PM.


 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •