jQuery UI Widgets › Forums › Editors › NumberInput › the Caret jump to the second digit when type
Tagged: decimal, jqxnumberinput, numberinput
This topic contains 5 replies, has 3 voices, and was last updated by gwjwin 9 years, 11 months ago.
-
Author
-
Hi, when I using
inputMode: 'simple', decimalDigits: 0
mode, like this:$("#jqxNumberInput").jqxNumberInput({ width: '250px', height: '25px', theme: 'energyblue', spinButtons: true, inputMode: 'simple', decimalDigits: 0 });
and select all numbers in the box, type any digit, caret will jump. (e.g. I want to type 2, but result as 20. )
Is this a bug or designed for some reason? Thanks.Version: jQWidgets v3.6.0
Hello gwjwin,
This is not a bug. The behavior is by default because ‘decimal’ property is set to 0. If you input any digit and delete the ‘0’ you can save value without the ‘0’. You can also update jQWidgets to v3.7.0 if you want.
Best Regards,
NadezhdajQWidgets team
http://www.jqwidgets.com/Thanks Nadezhda,
You are right, I can input what I want, but just annoying.
For most website clients, it doesn’t make sense always deleting the last ‘0’ after input a new number.
If I setinputMode: 'advanced'
, the behavior is what I want.
Is there way to setinputMode: 'simple'
and not let caret jump? using javascript or there is some setting for that?Hi gwjwin,
Unfortunately, this is not possible. If you want to specify decimal digits without “0” by default, you can use the other mode of the Number Input.
Best Regards,
NadezhdajQWidgets team
http://www.jqwidgets.com/Hi gwjwin,
I had the exact same problem using
$(“#jqxNumberInput”).jqxNumberInput({
width: ‘250px’,
height: ’25px’,
spinButtons: true,
inputMode: ‘simple’,
decimalDigits: 0
});I have changed it to the following to get the desired result.
$(“#jqxNumberInput”).jqxNumberInput({
width: ‘250px’,
height: ’25px’,
spinButtons: true,
promptChar: ” “,
groupSeparator: “”,
decimalDigits: 0
});It works.
The only problem now is that when you highlight the number, it also highlight the blank spaces, but I am fine with that (much better that deleting the 0 every time).
Also you cannot have a group separator (was not available in simple mode anyway).Hope this helps
regards
Thanks JohannJvR, it works!!
Highlighting the blank spaces is much better than deleting the ‘0’, great 🙂 -
AuthorPosts
You must be logged in to reply to this topic.