Why is my spinbox not working?

TheBigK

Well-known member
Here's what I have -

Code:
<input type="text" class="textCtrl number Spinbox" name="scheduleQty" value="5" min="1" step="1">
            <input type="button" class="button spinBoxButton up" value="+" data-plusminus="+" tabindex="-1">
            <input type="button" class="button spinBoxButton down" value="-" data-plusminus="-" tabindex="-1">

This code shows the spinbox with + and - button; but clicking on the buttons doesn't increment / decrement the number inside the text box.

PS: I tried to write the code referring the spinbox that appears inside the thread_create template.
 
Update: Changing input type to "number" fixed the problem. :X3:

and those two lines for + and - were not needed. Bah!

PS: Still don't know why does it work with input type as 'text' on the poll options on thread_create page?
 
Your first code didn't work because you wrote Spinbox instead of SpinBox (classes are case sensitive).
When you used number type it worked because input of type number automatically gets the class SpinBox (by js).
In additional, number inputs are automatically changed to text type in order to avoid the default browser handling of number inputs.
 
Top Bottom