Skip to content

Commit bb7374e

Browse files
Validate short description (#1105)
* Create readme.md * Create validShortDescription.js
1 parent 262862f commit bb7374e

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed
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 less than 10 characters, it displays an alert and prevents submission.
3+
This helps maintain data quality by ensuring adequate information is provided.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
function onSubmit() {
2+
var shortDescription = g_form.getValue('short_description');
3+
if (shortDescription.length < 10) {
4+
alert('Short Description must be at least 10 characters long.');
5+
return false; // Prevent form submission
6+
}
7+
return true; // Allow form submission
8+
}

0 commit comments

Comments
 (0)