Skip to content

Commit 71f93db

Browse files
authored
Validation code snippet (#1513)
* Create ShortDescriptionLength.js * Create readme
1 parent abd74aa commit 71f93db

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
2+
function onSubmit() {
3+
var shortDescription = g_form.getValue('short_description');
4+
if (shortDescription.length > 100) {
5+
alert('Short Description must be not be more than 100 characters long.');
6+
return false; // Prevent form submission
7+
}
8+
return true; // Allow form submission
9+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
This Client Script validates the "Short Description" field before the form is submitted.
2+
If the description is more than 100 characters, it displays an alert and prevents submission.
3+
This helps maintain data quality by ensuring adequate information is provided.

0 commit comments

Comments
 (0)