EmKayDK / jstepper

A jQuery plugin usable for making a numeric textfield value easy to increase or decrease
ISC License
18 stars 6 forks source link

prevent overflow to maxValue when minLength exceeded? #8

Closed jersingh closed 9 years ago

jersingh commented 9 years ago

Is it possible to prevent entry that overflows minLength from resenting the control to maxValue?

In a scenario like this: Stepper({minValue:1, maxValue:999, minLength:3}); I can see a user entering say "1111" when they meant to type "111" and saving without noticing and they've saved a "999" instead.

Would be nice if the value just stops at "111" if they go past the allowed length.

Thoughts?

EmKayDK commented 9 years ago

Good point. It is not possible right now. However, I will add an option to switch between the default mode and the mode that you are describing.

EmKayDK commented 9 years ago

You now have the option to set an overflowMode with the new 1.5.0 release. Take a look at the documentation at http://jstepper.emkay.dk/.

Thanks for the suggestion :+1: