Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
52
rated 0 times [  59] [ 7]  / answers: 1 / hits: 185773  / 11 Years ago, fri, august 16, 2013, 12:00:00

I realized a software application management invoicing after having tested my program I noticed the following error:
my table in sqlserver contains: price numeric (6,2)
the user of my program enter price as 555.00 is good.
but when he put 555555 it's error, so I need to specify the mask where the mantissa is optional 0 to 999 and the decimal part is programmable 2 or 3 according to choice of the user, I'm using JQuery Masked input plugin and I have not found good regular expression, please, help, I'm working with jsp / servlet.


More From » jquery

 Answers
3

You can use jquery numeric for numbers.

The current version does allow what you're looking for but someone has changed the code a little bit and it works:


HTML


<input class="numeric" type="text" />

JQuery


$(".numeric").numeric({ decimal : ".",  negative : false, scale: 3 });

This is the whole source.

And I've prepared this fiddle so you can see how it works.


[#76317] Thursday, August 15, 2013, 11 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
christianu

Total Points: 481
Total Questions: 124
Total Answers: 99

Location: Trinidad and Tobago
Member since Thu, Dec 1, 2022
2 Years ago
christianu questions
;