We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a47a5ec commit df1255dCopy full SHA for df1255d
Client-Side Components/Client Scripts/Validate Short Description/Validate Short Description.js
@@ -0,0 +1,20 @@
1
+function onSubmit() {
2
+ var shortDescription = g_form.getValue('short_description');
3
+
4
+ // Check for length
5
+ if (shortDescription.length > 100) {
6
+ alert('Short Description must not be more than 100 characters long.');
7
+ return false; // Prevent form submission
8
+ }
9
10
+ // Check for special characters
11
+ var specialCharsRegex = /[^a-zA-Z0-9\s]/g;
12
+ var specialChars = shortDescription.match(specialCharsRegex);
13
14
+ if (specialChars) {
15
+ alert('Short Description contains invalid characters: ' + specialChars.join(', '));
16
17
18
19
+ return true; // Allow submission if both checks pass
20
+}
0 commit comments