How, on client side, to dynamically change Downdownlist items.

Q

Q. John Chen

I have two dropdownlist controls. ddlCountry and ddlState.
Say that ddlCountry has items United States and Canada, I want only
list US states if United States is selected and Canadian provices if
Canada.

It's simple to do it on the server but how can I do it ON CLIENT SIDE
with JavaScript.
 
E

Eliyahu Goldin

In addition to ddlCountry and ddlStates prepare 2 hidden ddls: ddlUSStates
and ddlCanadianStates. On ddlCountry change copy options from the right
ddlXXStates to ddlStates.

Eliyahu
 

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

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,682
Members
48,796
Latest member
Greg L.

Latest Threads

Top