How to validate the field to allow only numbers,(comma).(dot) Please suggest if script is needed
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-16-2024 06:08 AM
How to validate the field to allow only numbers,(comma).(dot)
Please suggest if script is needed
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-16-2024 06:22 AM
Hello @Archana23 ,
Previously, I have given you a solution. Please find below the thread:
Now, if you want to accept a comma in your input, then please use the below regex:
Regex - ^\d{1,3}(,\d{3})*(\.\d{1,2})?$
This will accept 1,234,567.89 , 1,234.56 types of numbers. If you want others, please let me know.
Please mark this as "correct" and "helpful" if you feel this answer helped you in anyway.
Thanks and Regards,
Ashish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-16-2024 06:32 AM
It should accept dot,comma, numbers.
After comma or dot it should accept only 2 digits.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-16-2024 06:50 AM
Please use the below updated regex:
^\d+(,\d{1,2}|\.\d{1,2})?$
This will accept the below inputs. If these are not with your requirement, please share your inputs.
123
123,1
123,12
123.1
123.12
Please mark this as "correct" and "helpful" if you feel this answer helped you in anyway.
Thanks and Regards,
Ashish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-16-2024 07:11 AM
Not working as expected, it is not accepting comma