I'm trying to figure out a way to use the inputMask to handle a money field.
I need to be able to handle a variable number of digits followed by a decimal and 2 more digits - like 9999.99
My question is how can I make the number of digits in front of the decimal variable, so the user can enter 9.99 or 99999.99
I know you can make trailing values optional by using the question mark, is there a way to make leading values optional?
Maybe something like 000009.99 where the leading values are optional, but must be digits?
Thanks.
<p:inputMask> Question / Suggestion
-
- Posts: 24
- Joined: 03 Dec 2009, 22:00
I have the same question. Would be nice if someone can answer this.
Thank you
Thank you
JBoss AS 7.1.1
PrimeFaces 3.3.1
PrimeFaces-Extension 0.5.1
PrimeFaces-Mobile 0.9.3
Mojarra 2.1.7-jbossorg-1 (20120227-1401)
PrimeFaces 3.3.1
PrimeFaces-Extension 0.5.1
PrimeFaces-Mobile 0.9.3
Mojarra 2.1.7-jbossorg-1 (20120227-1401)
-
- Posts: 6144
- Joined: 10 Sep 2011, 21:10
I believe p:inputMask is using jQuery, so I searched google for jquery input mask currency, and wanted to suggest that you see the following which should help you out.
jQuery plugin for formatting inputs
Above URL references this: Masked Input Plugin
If you find an answer to your question, then please reply with your solutions, so it will be here for community for later reference.
jQuery plugin for formatting inputs
Above URL references this: Masked Input Plugin
If you find an answer to your question, then please reply with your solutions, so it will be here for community for later reference.
Howard
PrimeFaces 6.0, Extensions 6.0.0, Push (Atmosphere 2.4.0)
TomEE+ 1.7.4 (Tomcat 7.0.68), MyFaces Core 2.2.9, JDK8
JUEL 2.2.7 | OmniFaces | EclipseLink-JPA/Derby | Chrome
Java EE 6 Tutorial|NetBeans|Google|Stackoverflow|PrimeFaces|Apache
PrimeFaces 6.0, Extensions 6.0.0, Push (Atmosphere 2.4.0)
TomEE+ 1.7.4 (Tomcat 7.0.68), MyFaces Core 2.2.9, JDK8
JUEL 2.2.7 | OmniFaces | EclipseLink-JPA/Derby | Chrome
Java EE 6 Tutorial|NetBeans|Google|Stackoverflow|PrimeFaces|Apache
I am having this same issue. I would like to be able to enter 9.99 or 999.99 for a dollar amount. I found that using "?999.99" as the Mask value, will allow both combinations. However, when the user types 9.99, the value is 999 in the input box. How can I force the typing of the decimal to jump to the decimal spot so that the user won't have to enter 009.99 (as most internet users won't type this).
-
- Posts: 3
- Joined: 04 Apr 2014, 16:55
Same [quote="mpalitang"] mpalitang[I am having this same issue. I would like to be able to enter 9.99 or 999.99 for a dollar amount. I found that using "?999.99" as the Mask value, will allow both combinations. However, when the user types 9.99, the value is 999 in the input box. How can I force the typing of the decimal to jump to the decimal spot so that the user won't have to enter 009.99 (as most internet users won't type this).]
Same Issueeee.... Any suggestion please
Same Issueeee.... Any suggestion please
-
- PrimeFaces Core Developer
- Posts: 3979
- Joined: 03 Dec 2010, 14:11
- Location: Bavaria, DE
- Contact:
i always use pe:inputNumber for money fields.
Thomas Andraschko
PrimeFaces | PrimeFaces Extensions
Apache Member | OpenWebBeans, DeltaSpike, MyFaces, BVal, TomEE
Sponsor me: https://github.com/sponsors/tandraschko
Blog: http://tandraschko.blogspot.de/
Twitter: https://twitter.com/TAndraschko
PrimeFaces | PrimeFaces Extensions
Apache Member | OpenWebBeans, DeltaSpike, MyFaces, BVal, TomEE
Sponsor me: https://github.com/sponsors/tandraschko
Blog: http://tandraschko.blogspot.de/
Twitter: https://twitter.com/TAndraschko
-
- Information
-
Who is online
Users browsing this forum: No registered users and 63 guests