Skip to content Skip to sidebar Skip to footer

Ajax Form Not Updating Values

I've got this form that updates user information on db. However, this functionality is not working with ajax (works with a simple submit with refresh). This postes form serialized

Solution 1:

From an initial glance, it looks like you aren't waiting until the document has loaded before binding an event handler. This means that #commit-changes doesn't even exist when you try to add the .click event handler.

To fix this in jQuery, wrap this around your entire code:

$(document).ready(function(){
  // do stuff
});

This function sends a callback to jQuery's document.ready handler, so that all the code only executes once the page is loaded.

Solution 2:

Remove the .submit() function. something like this.

  $.post("modules/user/updateuser.php",{data:$("#validation").serialize()},function(response){
     $("#response-update").html(response);
});

on the php side try to print_r($_POST['data']); and please post the output.

Solution 3:

In the updateUsers function (in Users class) you try to update the field nome or name ?

You are suppose to use nome only right?

Post a Comment for "Ajax Form Not Updating Values"