return false; and form submit

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
Lphp
Forum Commoner
Posts: 74
Joined: Sun Jun 26, 2011 9:56 pm

return false; and form submit

Post by Lphp »

I use following code to get data list , but in my data List , every row is a form , update is allowed,
my problem if I keep return false; my result form will not submit , if I remove the return false;
my update submit form is work , bu the java post is not work :cry:

Code: Select all

$(document).ready(function(){ 
    $("#btn").click(function(){            
      var s=$("#surname").val(); 
      var e=$("#email").val();
      var n=$("#name").val()
    
       $.ajax({
        type: "post",
        url: "/extractDataList.php",
        data: "surname="+s+"&email="+e+"&name="+n,       
       
        success: function(msg) {$("#mylist").html(msg)}
        });  
         
      
     return false;     // avoid to execute the actual submit of the form. 
   });
Post Reply