I am using numericstepper.js for my input textbox spinner. it works when I have the following code.
<script src="<?= site_url('assets/js/numericstepper.js') ?>"></script>
<script>
$('.continue-participation-btn').click(function(e) {
e.preventDefault();
var $form = $('form[name="apr-grade-participation-form"]').serialize();
$.ajax({
url: '/ajax/continue_participation',
type: 'POST',
data: $form,
success: function(res) {
if (res) {
$('.continuous-section').html(res);
$('html, body').animate({
scrollTop: 0
}, 900, function() {
$('.participation').removeClass('visible').addClass('completed-section');
$('.continuous-section').addClass('visible');
});
} else {
alert('Unable to process request');
}
}
});
});
</script>
<label for="">Number of Students</label>
<span class="numeric-stepper" style="display: block;">
<input size="2" class="number-of-day-input" id="day_<?=$part_count;?>" name="partdetail_pk_5[<?=$part_count;?>][day]" type="text" placeholder="000" pattern="[0-9]*" value="">
<button type="button" name="ns_button_1" maxValue = 999 value="1" class="plus">+</button>
<button type="button" name="ns_button_2" value="-1" class="minus">-</button>
</span>
However, when I use Ajax to load a page with input spinner textbox, it doesn't work. Anyone have an idea to solve this issue? Thanks