Select Drop Down List Value From Client-Side Script

P

PB

I have an aspx with 4 Drop-Down list boxes on it. All the list values are
hard-coded in the aspx.

I want a client-side JavaScript function to select a value in each of those
DDLs.

I can create the JavaScript function and wire it up to a link - but I need
help with the syntax required to select one of the values in each Drop-Down
list.

Thanks.
 
K

Kevin Spencer

document.getElementById("dropDownId").selectedIndex = number;

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Sometimes you eat the elephant.
Sometimes the elephant eats you.
 

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
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top