- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago - last edited 3 weeks ago
Hello all
I have a request to update an existing field on Incident form to a specific format as users are entering garbage data in the field now..
Entry should be restricted to alpha-numeric (for example: 123X)
What's the easiest way to accomplishing this?
thanks for your help
Solved! Go to Solution.
- Labels:
-
Incident Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
I suppose this depends on needs, but one way is through a Client Script (onChange for the respective field) where you do a regular expression evaluation like this:
var str = newValue;
str = str.replace(/[A-Za-z0-9]/g,"");
if (str != "") {
g_form.clearValue("<field>")
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
I suppose this depends on needs, but one way is through a Client Script (onChange for the respective field) where you do a regular expression evaluation like this:
var str = newValue;
str = str.replace(/[A-Za-z0-9]/g,"");
if (str != "") {
g_form.clearValue("<field>")
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Another example (maybe simpler)
var useRegEx = /[^A-Za-z0-9]/;
var str = newValue;
if (useRegEx.test(str)) {
g_form.clearValue("<field>");
}
