Short Site Title – no special characters or spaces, 15 chars max, mandatory i. If special characters
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-04-2023 10:39 AM
In catalog Client Script where in service portal Short Site Title – no special characters or spaces, 15 chars max, mandatory. If special characters or spaces are put in, please alert the user that these are not allowed and remove them automatically.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-04-2023 12:06 PM - edited 09-04-2023 12:08 PM
Hello @nikhil_anand,
For this you can add a client script of the onChange type, your code should look something like this:
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
if( newValue.indexOf('@')> -1 || newValue.indexOf(',')> -1 || newValue.indexOf('/')> -1 || newValue.indexOf('\\')> -1 || newValue.indexOf('.')>-1 || newValue.toString().length>15 || newValue.indexOf(' ')>-1){
alert('Please re-enter a valid title. Special characters such as \\ , @ . / are not allowed.');
g_form.setValue('title_name', '');
}
If you know other special characters or have other conditions, you can add them in if