This is my script that after changing input value should send it to php file with Ajax.But it's sending the actual value from input field which is set via php.How can i set the new value to be given?
var idg;
var newg;
$('input.readonly').live("click",
function() {
$(this).attr('readonly', false);
idgs=$(this).attr('id');
newg=$(this).attr('value');
$(this).change(function(){
$.ajax({
type:'POST',
url: 'new.php',
data: "idgs="+ idgs +"&newg="+ newg,
success: function(data) { $('.right').html(data); }
});
})
});
$(this).change(function(){
$.ajax({
type:'POST',
url: 'new.php',
data: "idgs="+ idgs +"&newg="+ $(this).val(),
success: function(data) {
$('.right').html(data);
}
});
});
var idg;
var newg;
$('input.readonly').live("click", function(){
$(this).attr('readonly', false);
$(this).change(function(){
idgs=$(this).attr('id');
newg=$(this).val();
$.ajax({
type:'POST',
url: 'new.php',
data: "idgs="+ idgs +"&newg="+ newg,
success: function(data) {
$('.right').html(data);
}
});
})
});
This should do it, you where filling idg and newg with the default values, before they changed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With