Catalog Client Script - Do Not Allow Submission

JA26
Tera Contributor

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;
    }
}
2 ACCEPTED SOLUTIONS

Hi @JA26 

Check what value is coming from those two variable - group &file . is it yes or Yes,

Then update condition accordingly.

View solution in original post

Vishal Jaswal
Tera Sage

Hello @JA26 

Just update both 'yes' to 'Yes' and your code should work as expected.

View solution in original post

5 REPLIES 5

Vishal Jaswal
Tera Sage

Hello @JA26 

Just update both 'yes' to 'Yes' and your code should work as expected.