Skip to content

Commit b12642a

Browse files
authored
Update readme.md
Expanded and clarified the Readme. Also included in the description the updated script.
1 parent aa368e3 commit b12642a

File tree

1 file changed

+25
-0
lines changed
  • Specialized Areas/Regular Expressions/Check for special characters

1 file changed

+25
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,26 @@
1+
# Special Characters Validation (onChange Client Script)
2+
3+
This script validates user input in a specific field and prevents the use of disallowed special characters.
4+
It is designed to run as an **onChange client script** .
5+
6+
## Functionality
7+
8+
- When the user changes the value of a field, the script checks if the new value contains any special characters.
9+
- If disallowed characters are found, the field is cleared and an error message is displayed to the user.
10+
- The validation uses a regular expression that includes common special characters such as `~`, `@`, `|`, `$`, `^`, `<`, `>`, `*`, `+`, `=`, `;`, `?`, `` ` ``, `'`, `(`, `)`, `[`, and `]`.
11+
12+
## How to Use
13+
14+
1. Add the script as an **onChange client script** on the field you want to validate.
15+
2. Replace the placeholder `'<your_field_name>'` in the script with the actual field name.
16+
3. Customize the regular expression if you want to allow or block different characters.
17+
18+
## Example Behavior
19+
20+
- Input: `Hello@World` → ❌ Invalid → Field is cleared, error message shown.
21+
- Input: `HelloWorld` → ✅ Valid → No action taken.
22+
23+
## Notes
24+
25+
- The script uses `g_form.clearValue()` to reset the field and `g_form.showErrorBox()` to display feedback.
126

0 commit comments

Comments
 (0)