Restrict spaces in IP address
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-29-2024 10:48 PM
Hi All
Can someone please help with below script, how can I validate whenever user enters spaces(beginning, end, inbetween) in the string. Should not allow user to enter spaces.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-29-2024 11:04 PM
You can try OOB Validation regex in variable. If this field is not available in your instance then you can pull it to the form using form layout configuration.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2024 10:56 PM
Hi @Ankita9793 ,
Avoid doing customization when the functionality already exist.
Go with what @Pravindra1 has recommended above... its simple and no code solution...
☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2024 10:58 PM
Hi Sohail,
The OOB solution does not fulfill my requirement.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2024 11:03 PM
Instead of creating a client script do a validation , you can create a regex rule and use it for validation as did above for IP address validation.
try this regex to avoid spaces > pattern = /^[0-9a-zA-Z]*$/;
Refer how IP Address regex is defined and use that as a base to create your own regex..
i hope this helps @Ankita9793
☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....