$reminderKoef = $marketplacePriorityMap[$guid]->reminder_koef ?? 2;
$minimalQuantity = $marketplacePriorityMap[$guid]->minimal_quantity ?? 2;
?>
- <td><input onblur="ajaxSavePrameter('<?= $guid ?>', 'reminder_koef', this.value)" value="<?= $reminderKoef ?>"/></td>
- <td><input onblur="ajaxSavePrameter('<?= $guid ?>', 'minimal_quantity', this.value)" value="<?= $minimalQuantity ?>"/></td>
+ <td><input onblur="ajaxSavePrameter('<?= $guid ?>', 'reminder_koef', this)" value="<?= $reminderKoef ?>"/></td>
+ <td><input onblur="ajaxSavePrameter('<?= $guid ?>', 'minimal_quantity', this)" value="<?= $minimalQuantity ?>"/></td>
</tr>
<?php endforeach; ?>
</tbody>
});
})
-function ajaxSavePrameter(guid, paramName, value) {
+function ajaxSavePrameter(guid, paramName, self) {
+ var value = self.value;
$.ajax({
url: window.location.href,
method: 'post',
data: {guid, paramName, value, [param22]: token22},
success: function(data) {
console.log(data);
+ self.style.background = 'lightgreen';
+ setTimeout(() => {
+ self.style.background = 'white';
+ }, 1000)
},
});
}
\ No newline at end of file