Field should we only Number in between 1-4094
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2024 03:03 AM
Hi All,
In catalog item one field that is VLAN ID4 It should want to be only numbers. In that number is only from 1 to 4094.
If user enter more than that numbers error message should want display.
Please let me know how to achieve this requirement.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2024 03:11 AM
you can use OOTB validation regex option available under type specification tab to achieve it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-14-2024 09:55 AM
Hi @Pravindra1 ,
Please provide more clarity on this. Please provide the any documents or articles it will helpful to me.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-14-2024 10:08 AM
Hi @Sirri
You can try the below code for on change client script and provide onchange field name as VLAN ID4
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
if(isNaN(newValue) || newValue < 1 || newValue > 4094){
g_form.clearValue('VLAN ID4'); // change to appropriate field name
g_form.addErrorMessage("you need to enter values between 1 to 4094")
}
}
Thanks and Regards
Sai Venkatesh