- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-22-2021 12:09 AM
Hello Team,
I have field called fee, which should contain numbers and $,could you help on this, as it should take special character like $
var regexp = /^[+]?\d*$/;
if(!regexp.test(newValue)){
alert('Please enter numeric value');
g_form.setValue('u_estimated_fees','');
}
i have above script to check for numbers only but how to check for special character
Thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-22-2021 12:29 AM
Use following regex
it will check for "$12" format only
var regexp = /^[$][0-9]+$/;
if(!regexp.test(newValue)){
alert('Please enter numeric value');
g_form.setValue('u_estimated_fees','');
}
if you want $12 or 12
use this
/^[$]?[0-9]+$/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-22-2021 12:29 AM
Use following regex
it will check for "$12" format only
var regexp = /^[$][0-9]+$/;
if(!regexp.test(newValue)){
alert('Please enter numeric value');
g_form.setValue('u_estimated_fees','');
}
if you want $12 or 12
use this
/^[$]?[0-9]+$/