Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.

3 Check boxes but only one can be checked at a time.

Avatar

Former Community Member
Scripting noob needs help figuring out how to make 3 check boxes of which only one can be checked at a time. E.G. Credit card type:



[x]Visa [ ]M.C. [ ]Disc.



I could also use ideas how to make a "save a copy" button or a way to make sure the form can be filled out but only a copy can be saved and the original cannot be overwritten.



TIA
3 Replies

Avatar

Former Community Member
Hi chad,

If you want to make an exclusion group, you could just use radio buttons rather than scripting checkboxes. Only one radio button of a group can be selected.

If you want to use checkboxes anyway, here's the script:



if (this.rawValue == 1) { //this stands for current checkbox

formname.subformname.FirstCheckBoxName.rawValue = 0 // clear checkbox

}

if (this.rawValue == 1) { //this stands for current checkbox

formname.subformname.SecondCheckBoxName.rawValue = 0 // clear checkbox

}

This script would be placed in the click event of the 3rd checkbox, with JavaScript selected as the language.



As for saving a copy, you'll first have to enable saving with either Acrobat 8 or with ReaderExtension software for Designer forms so that Reader users can save a copy.



Regards,

Dave

Avatar

Former Community Member
I'm fairly new as well. I want to have users choose up to three selections from a check box list of eight. Any help in how to do this would be much appreciated. Thanks, Sare.

Avatar

Former Community Member
You could add the raw values together and make them all read only if the total of the raw values reaches 3, then provide a reset button to uncheck all the check boxes and make them active again. It's not the most elegant solution, but it would work.