on 11-14-2017 9:00 AM
Hi,
i trying to validate entered data into input control on live change.
Input control should accept max 14 characters - 10 digits followed by comma and 3 more digits.
For example: 1234567890,657
There has to be only one comma, another comma should not be allowed.
I tried the following code:
var enteredVal = oEvent.getParameter("value");
var filteredVal = enteredVal.replace(/[^\d+(,{1}\d{3})?$]/g, '');
I am able to enter only digits and comma upto 14 characters as the max length of control is set to 14.
Comma can come at any position, but after comma max 3 digits are allowed.
Few more examples:
1,234
3674,12
89473,7
How do i restrict second occurrence of comma and restriction digits after comma.
Please suggest possible options.
Thanks,
Saurabh.
User | Count |
---|---|
85 | |
10 | |
9 | |
9 | |
6 | |
6 | |
6 | |
5 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.