# Problem with radio buttons in as2

**URL:** <https://forum.kirupa.com/t/problem-with-radio-buttons-in-as2/328149>\
**Category:** flash\
**Created:** [April 22, 2012, 11:09pm UTC](https://forum.kirupa.com/t/problem-with-radio-buttons-in-as2/328149 "2012-04-22T23:09:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![aleksandurg](https://avatars.discourse-cdn.com/v4/letter/a/85f322/32.png) [@aleksandurg](https://forum.kirupa.com/u/aleksandurg)\
**Post date:** [April 22, 2012, 11:09pm UTC](https://forum.kirupa.com/t/problem-with-radio-buttons-in-as2/328149/1 "2012-04-22T23:09:57Z")

</div>

Hi, i have problem with 2 radio buttons. I`m tryin to use if else for the radio buttons. I have two input text fileds and i want when radiobutton1 is selected, (textfield1.\_visible = true and textfield2.\_visible = false). If i select radiobutton2 (textfield1.\_visible = false and …)

this is the code:

if(radiob1.selected == true){  
workgroup.\_visible = true; //workgroup and workgroup2 are the textfields  
workgrou2.\_visible = false;

}  
else if (radiob2.selected == true){  
workgroup2.\_visible = true;  
workgrou.\_visible = false;

}

Thank you!
