I want to avoid the use of special characters (like: "," or "()") in a specific Field

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-18-2023 01:42 AM - edited 01-18-2023 01:43 AM
Hi there! 🙂
I want to avoid the use of special characters in a specific Field...
what is the best way to achieve this?
My Business Users are using Characters like "," or "()" in a specfic Field, which will produce a nightmare in my exports, If I receive requests for exporting Data via Querybuilder or Reports...
What is the best way to force my Business Users to not use these Characters in a specfic field?
I want to avoid my Business Users that they can use these characters in future entries in a specific Table
Thank you very much for every advise!
Kind Regards
Sven
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-18-2023 01:56 AM
Hi @Sven Heide ,
You can write onChange- Client script with a regular expression to disallow special characters (like: "," or "()").
var specials=/,()/;
var name = g_form.getValue('<field_name>');
if (specials.test(name)){
g_form.addErrorMessage("Sepecial Characters "," & "()" are allowed");
g_form.setValue('<field_name'','');
}
Regards,
Ratnakar

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-18-2023 02:08 AM
Hi @Sven Heide ,
Whichever BR you are triggering
fetch the value for example special characters are in description
var description = current.description;
if(description.includes(",") || description.includes("()")){
gs.addInfoMessage("Please do not enter special characters");
retun false;
}
else{
//do your scripting
}
Please mark correct if my response has solved your query.
Cheers,
Mohammed Basheer Ahmed.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-18-2023 02:10 AM
If you want to do it on client script then you can do it on submit - client scripts if you want during save or submit or if you want it on a particular field then go for on change client script
var description= g_form.getValue("column_name")
if(description.includes(",") || description.includes("()")){
gs.addInfoMessage("Please do not enter special characters");
retun false;
}
else{
//do your scripting
}
Please mark correct if my response has solved your query.
Cheers,
Mohammed Basheer Ahmed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-18-2023 02:24 AM
Hi @Sven Heide ,
The below code will work for all special characters not only for ", ()". Because as of now there are using these two characters in future if they might use other character as well. So, i think below code will helps you to stop from all special characters
var regex = new RegExp("^[a-zA-Z0-9]*$"); //no special characters
if(!regex.test(newValue)){
g_form.addErrorMessage('Please Don't enter any special character');
g_form.setValue('<field_name>', ''); // if you want to make field as blank if any special character founds then you can add this line
}
If it works Please mark my response as Correct / Helpful
Regards,
Kalyan