jQuery UI Widgets › Forums › Editors › NumberInput › To remove group separator and decimals in number input
Tagged: decimalDigits, decimalSeparator, jqxnumberinput, numberinput, Symbol
This topic contains 5 replies, has 2 voices, and was last updated by Nadezhda 9 years, 7 months ago.
-
Author
-
Hi,
I am building a jqwidget form which has currency input fields.By default i am getting group separators and decimal places like $__,___,__0.00.
Is it possible to remove those separators and decimal places and have only $ symbol.Thanks in advance 🙂
Hello nikhil22,
Here is an example with jqxInput: http://jsfiddle.net/vyp7ffcs/.
In other case with jqxNumberInput you should have ‘decimal’ because default value is 0: http://jsfiddle.net/erp2ojb4/.Best Regards,
NadezhdajQWidgets team
http://www.jqwidgets.com/Hi Nadezhda,
Thanks for the reply.Is it possible that on blur event only comma separators are added without any underscores.
Hi nikhil22,
In the following example you can find how to use comma separator with ‘blur’ event.
<!DOCTYPE html> <html lang="en"> <head> <title></title> <link rel="stylesheet" href="../../jqwidgets/styles/jqx.base.css" type="text/css" /> <script type="text/javascript" src="../../scripts/jquery-1.11.1.min.js"></script> <script type="text/javascript" src="../../scripts/demos.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxcore.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxnumberinput.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxbuttons.js"></script> <script type="text/javascript"> $(document).ready(function () { // Create jqxNumberInput $("#numericInput").jqxNumberInput({ width: '250px', height: '25px' }); $("input.jqx-widget-content").blur(function () { $("#numericInput").jqxNumberInput({ decimal: 0, inputMode: 'simple', decimalSeparator: "," }); }); }); </script> </head> <body class='default'> <div style='margin-top: 10px;'> Number </div> <div style='margin-top: 3px;' id='numericInput'> </div> </body> </html>
Best Regards,
NadezhdajQWidgets team
http://www.jqwidgets.com/Hi Nadezhda,
I tried your code but nothing is changing.
On blur the input content is getting reset to 0.00Hi nikhil22,
Please, make sure all your jQWidgets files are updated to version 3.7.0.
Best Regards,
NadezhdajQWidgets team
http://www.jqwidgets.com/ -
AuthorPosts
You must be logged in to reply to this topic.