Checkbox auto check if
Hello there and happy new year 2021 !
I am actually working on a form and I am struggling with some JS.
I have two sets of checkoxes (let's say CB1 and CB2 to sum up) with 4 instances for each with different export values (CB1 : A, B, C, D // CB2 : A, B, C, D). The first set corresponds to the classification of a client and the second one corresponds to the possibility for the client to overwrite the above mentionned information with a new one (A client which is CB1 A can decide to be CB2 C). So far, no trouble for me.
Here comes my problem :
Later on the document, the value of the selected checkbox is repeated as a sum up of the document (with checkboxes) and I have to find a way to express the following :
IF CB2 is not checked, take the value of CB1
IF, CB2 is checked, take the value of CB2.
Can someone help me, I am still learning JS... ?
Thanks.
Guillaume
