You're triggering the slide
event again when you call prev
, and again and again ad infinitum.
Instead of pausing and going back, cancel the event with return false;
or use e.preventDefault();
$('#carousel-example-generic').on('slide.bs.carousel', function(e) {
console.log(e);
$('.item.active',this).each(function(i,el) {
if ($(el).find('input:first').val()==='') {
e.preventDefault();
}
});
});