Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bootstrap Touchspin OnChange event

I have the bootstrap touchspin input spinner initialized and I want to call a function whenever the button is pressed.

I tried this: $('#spinedit').trigger('touchspin.on.startspin', function () {alert("HI");});

However, it doesn't do anything.

Thanks

like image 374
davids.1 Avatar asked Dec 11 '25 18:12

davids.1


1 Answers

You are trying to trigger than bind the event touchspin.on.startspin to the element. The correct way to bind is

$('#spinedit').on('touchspin.on.startspin', function () {alert("HI");});

touchspin.on.startspin - Triggered when the spinner starts spinning upwards or downwards.

For other events you can see their docs(See Triggered events)

Fiddle Demo

like image 93
anpsmn Avatar answered Dec 13 '25 07:12

anpsmn



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!