The problem could be the reference to the control was not correct.
Or your form was not set as a Dynamic XML form.
You need do the following to make the Form as Dynamic.
1) Goto File menu -> Form Properties and select Defaults tab. Change the Default Render Format as Dynamic XML form
2) Select the Preview Tab. Set the Preview type as "Interactive Form" and Preview Adobe XML form as Dynamic XML form
3) Finally while saving the PDF select Save As Type as "Adobe Dynamic XML Form".
I have a put in a sample file for your reference with the similar logic.
In my example, I am only hiding and displaying them based on the previous answer.
https://acrobat.com/#d=LlEgTgo3**oSPJlYGxGTKw
Thanks
Srini