- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2020 09:50 AM
I have this client script that should only allow 1 checkbox to be selected, but when I test it still lets me select I agree or I disagree. Can someone help me out?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2020 01:05 PM
Another thought is to possibly just ask if they Agree and then have a Yes/No drop down or if it is important that they choose agree or disagree use a multi-Choice box. Both these options could be made mandatory unlike check boxes and they can only chose one. Example of a multi-choice field.
You could also use a select box with options I Agree or I Disagree.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2020 09:56 AM
That seems a bit much. A simpler script like this will work
if(g_form.getValue('v_prod') == 'true' && g_form.getValue('v_stage') == 'true'){
alert('Only 1 environment can be selected.');
return false;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2020 11:28 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2020 11:46 AM
Seems you missing function.
Try below.
function onSubmit() {
//Type appropriate comment here, and begin script below
if(g_form.getValue('v_prod') == 'true' && g_form.getValue('v_stage') == 'true'){
alert('Only 1 environment can be selected.');
return false;
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2020 12:13 PM
This script allows me to have nothing check and I can still submit