accessing selectIndex property

B

barry

I am using the animation extender in asp.net ajax and have a RadioButtonList
in a div and access it in javascript through the extender.

The object passed into the javascript function is definitely the
RadioButtonList but I can not seem to get to the selectIndex property.

When I do a Object.id it does however give me the correct name of the
RadioButtonList id name.

Just not sure of the syntax to get at the selectIndex property

thanks
 
B

bruce barker

a radiolist is just a span or table (depending on style) with radio
buttons in it. the id refers to the span/table, not the buttons. to get
the selected index, you get the span/table by id, walk its children
nodes (may need to recurse) looking for radio buttons (tagname=="INPUT"
type=="radio"). count the buttons until you find a checked one. that is
the index. to get the value instead of the index (more useful in
javascript) get the value of the checked one.

-- bruce (sqlwork.com)
 
B

barry

thank you

bruce barker said:
a radiolist is just a span or table (depending on style) with radio buttons
in it. the id refers to the span/table, not the buttons. to get the
selected index, you get the span/table by id, walk its children nodes (may
need to recurse) looking for radio buttons (tagname=="INPUT"
type=="radio"). count the buttons until you find a checked one. that is the
index. to get the value instead of the index (more useful in javascript)
get the value of the checked one.

-- bruce (sqlwork.com)
 

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,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top