I have inputs which are dynamically created and I'm attempting to submit their value using onBlur. I'm still new to jQuery and AJAX, could someone explain to me why the function isn't being called?
Input:
<input type="text" class="quantity" onblur="updateQuantity()" name="quantity[]"/>
Script:
<script>
function updateQuantity() {
$(".quantity").blur(function(){
var quantityValue = $(this).val();
$.ajax({
url: "pages/inventory_request_action.php",
cache: false,
type: 'POST',
data: quantityValue,
success: function(data) {
// do something
}
});
});
}
</script>