输入字段值随着下拉变化而变化,但是如果我在表格中更改输入字段值,则下拉输入字段值的更改不会改变..这是jquery ..
$('#Add-DSR-Form').on( 'change', 'tbody td select.cylinder_id', function () {
var $row = $(this).parents("tr"),
index = $row.attr('data-item-index');
var CylinderID = $(this).val();
if(CylinderID < 1)
{
$row.find('[id="Rate[]"]').attr('value', "").end();
grandTotal();
return false;
}
else
{
var Action = 'GetCylinderDetail';
var dataString = 'Action='+ Action +'&CylinderID='+ CylinderID;
$.ajax({
type: "POST",
url: "includes/loader_functions.php",
data: dataString,
cache: false,
success: function(result)
{
//alert(result);
//alert(JSON.parse(result));
var obj = JSON.parse(result);
$row.find('[id="Rate[]"]').attr('value', obj.CylinderPrice).end();
grandTotal();
return true;
}
});
}
});