- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2024 01:52 AM
Hi All,
I have a field for frequency in catalog item to update it in Custom Table.
This field should be 234.234 format. how can i restrict it in Client Script.
Below is my Client Script.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2024 03:11 AM
Hi @karthik65 ,
Use below script, i have tested it, working fine. it will accept 3 digit before and after decimal. If you before digit can be anything then use :var reg = /^\d+\.\d{3}$/;
var reg = /^\d{3}\.\d{3}$/;
var ans = g_form.getValue('frequency_number_u');
if(!reg.test(ans))
{
alert('Please enter a valid value.');
g_form.clearValue('frequency_number_u');
}
-------------------------------------------------------------------------
If you found my response helpful, please consider selecting "Accept as Solution" and marking it as "Helpful." This not only supports me but also benefits the community.
Regards
Runjay Patel - ServiceNow Solution Architect
YouTube: https://www.youtube.com/@RunjayP
LinkedIn: https://www.linkedin.com/in/runjay
-------------------------------------------------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2024 06:06 AM
How can i set decimal for a frequency field after three numbers?