problem in calling javascript function in radiobuttonList

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
 
S

Siva M

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,571
Members
45,045
Latest member
DRCM

Latest Threads

Top