On update i get ajax data in sub_nav. before ajax update the click events of the buttons works but after ajax data is loaded in the div , the click events do not work.
you had given me solution as above for form submission with ajax call. " $('#sub_nav').on('click', '.quantity_box_button_up', function(event) {} "
I tried to code it like that but doesnt work on normal data too please help
<div id="sub_nav">
<div>
<input type="button" class="quantity_box_button_down" value="-" >
<input type="text" name="cartrowqty[1]" value="7" maxlength="3" size="5" />
<input type="button" class="quantity_box_button_up" value="+" >
</div>
</div>
<script>
$(document).ready(function(e) {
//$('#sub_nav').on('click', '.quantity_box_button_up', function(event)
$(".quantity_box_button_up").click(function(e) {
var abc=parseInt(($(this).prev("input").val()));
$(this).prev("input").val(abc+1);
});
$(".quantity_box_button_down").click(function(e) {
var bbc=parseInt(($(this).next("input").val()));
alert(bbc);
if(bbc==1)
{
}
else
{
$(this).next("input").val(bbc-1);
}
});
});
</script>