[jQuery] ajax submit val() not submitting updated data
Hi all,
I've been working with this page for a while, and I can't seem to
figure out the problem (it's running locally as it is just a tool for
me to try to fix up some data).
Basically what I have is a page that looks at the user submitted data.
The data is in a input box - but for simplicity it is not in a form.
This way if I need to update the data, I can just change it in the
input field and click the link and it updates the field via ajax.
The problem is that when I update the input field, and then click the
accept, the data that is being returned isn't the changed data, but
the original data.
The jquery i am using looks like this
[code]
$('.button').click(function(){
var update = $(this).attr('id');
var thisEntry = $(this).parent('#thisList').html();
var updatedEntry = $(thisEntry+'input.name').val();
alert(updatedEntry);
var id = $(thisEntry+'.name').attr('id');
$.ajax({
type: 'POST',
url: 'fixing.php',
data: 'name='+updatedEntry+'&id='+id,
success: function(response){
$('.'+id).fadeOut('slow');
}
});
});
[/code]