Problem: Ajax Return false is not returning false, the codes values are being put witin the address bar, and the page is being refreshed.

Question: Did I put the return false in the wrong area? How can I fix this problem?


$(".status_reply").click(function() {
              var status_id = $("input[name=status_id]").val();
              var user_id = $("input[name=user_id]").val();
              var reply_id = $("input[name=reply_id]").val();
              var whoto = $("input[name=whoto]").val();
              var from = $("input[name=from]").val();
              var date = $("input[name=date]").val();
              var reply = $("textarea#reply_value").text();
              var dataString = 'status_id='+ status_id + '&user_id=' + user_id + '&reply_id=' + reply_id + 'whoto='+ whoto + '&from=' + from + '&date=' + date + '&reply=' + reply;
             // alert (dataString);return false;
                type: "POST",
                url: "home/status_reply",
                data: dataString,
                success: function() {
                        url: 'home/update_replies/'+status_id,        
                        data: "html",                
                        success: function(data) {        
                            var newComment = $('<div>').html(data);
                            return false;  
                return false; 
          });//end of button click

Solved! All I had to do is take off the form tags.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.