Catalog Client Script - Do Not Allow Submission
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
The script should not allow submission if either values choice is 'yes'
function onSubmit() {
var group = g_form.getValue('was_the_group_listed');
var file = g_form.getValue('was_the_file_listed');
if (group == 'yes' || file == 'yes') {
g_form.addErrorMessage('Please check KBXXX');
return false;
}
}
5 REPLIES 5
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
an hour ago
It is allowing submission when I select yes. It should not allow submission and a banner should populate at the top with the message.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
an hour ago
Hi @JA26
Check what value is coming from those two variable - group &file . is it yes or Yes,
Then update condition accordingly.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
an hour ago
hi @JA26 ,
Please validate the values of the following fields in the script:
var group = g_form.getValue('was_the_group_listed');
var file = g_form.getValue('was_the_file_listed');
Ensure you are checking the actual stored values (like 'yes', 'true', or '1') and not the display label (Yes).
You can temporarily add an alert() to confirm what values are being returned:
You can temporarily add an alert() to confirm what values are being returned:
If this information proves useful, kindly mark it as helpful or accepted solution.
Thanks,
BK
Thanks,
BK
