• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Fixed  spinboxunit: issues with "min" attribute

Jeremy

Well-known member
#1
I've found another issue with spinboxunit. Here's my example code:
HTML:
<xen:spinboxunit label="{xen:phrase bbcm_numberOfOptions}:" name="numberOfOptions" value="{$code.numberOfOptions}"  min="1" size="8">
If I try to go below 1 using the +/- buttons, it halts at 1. If I type in 0, it jumps it up to 1. My issue lies within the fact that if $code.numberOfOptions was below 1 when the page was loaded, the box stays at 0. Once a change is made, its impossible to change it back. Could a JS or some other trick be implemented that auto-places the minimum if stored value < minimum? Or is this something to be left to add-on developers to check for in upgrades such as mine (the box has a different value in the beta version as it does in the latest stable release)?