PC Review


Reply
Thread Tools Rate Thread

accessing selectIndex property

 
 
barry
Guest
Posts: n/a
 
      2nd Feb 2007
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


 
Reply With Quote
 
 
 
 
bruce barker
Guest
Posts: n/a
 
      2nd Feb 2007
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)


barry wrote:
> 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
>
>

 
Reply With Quote
 
barry
Guest
Posts: n/a
 
      2nd Feb 2007
thank you

"bruce barker" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>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)
>
>
> barry wrote:
>> 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



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
selectindex always = 1 from datacombo chris@oaksong.com Microsoft ASP .NET 1 31st Oct 2005 07:59 PM
Setting property value to string or accessing property methods Brian Mitchell Microsoft VB .NET 2 26th May 2005 01:27 PM
Accessing a property using a string containing the property name? Don Microsoft VB .NET 4 8th Oct 2004 05:38 PM
DataGrid.SelectIndex property Help! Microsoft Dot NET 0 15th Nov 2003 09:45 PM
ListView selectindex event bug????? HABJAN Žiga Microsoft VB .NET 10 14th Oct 2003 11:23 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:11 PM.