problem in calling javascript function in radiobuttonList

  • Thread starter Thread starter novice_developer
  • Start date Start date
N

novice_developer

Hi All,

there is a radiobuttonlist having 2 list items (state & zipcode).
when i select state radiobutton the zipcode textbox should be disabled
and when i select a zipcode radiobutton the state textbox should be
disabled. And i need to handle this in client side only.
i'm not able to call a javascript function for radiobuttonlist.
can please some one help me to get out of this...

advance thanks
Mahi
 
In the page_load event, have:

RadioButtonList.Items[0].Attributes.Add("onclick", "document.forms[0]." +
txtZip.ClientID + ".disabled=true;" + txtState.ClientID +
".disabled=false;"); //Item 0 is State
RadioButtonList.Items[1].Attributes.Add("onclick", "document.forms[0]." +
txtZip.ClientID + ".disabled=false;" + txtState.ClientID +
".disabled=true;"); // Item 1 is Zip

Hope this helps.

message
Hi All,

there is a radiobuttonlist having 2 list items (state & zipcode).
when i select state radiobutton the zipcode textbox should be disabled
and when i select a zipcode radiobutton the state textbox should be
disabled. And i need to handle this in client side only.
i'm not able to call a javascript function for radiobuttonlist.
can please some one help me to get out of this...

advance thanks
Mahi
 
Back
Top