Bug Tracker

Opened 12 years ago

Closed 12 years ago

#9683 closed bug (invalid)

Access items with checked / unchecked for Radio Button list.

Reported by: anonymous Owned by: anonymous
Priority: low Milestone: 1.next
Component: misc Version: 1.6.1
Keywords: Cc:
Blocked by: Blocking:


Hello ,
I getting problems to set attributes checked=checked/true in radiobuttonlist in asp.net using jquery..

<asp:RadioButtonList runat="server" ID="rdlCategory" AppendDataBoundItems="true" RepeatDirection="Horizontal" RepeatLayout="Flow" > </asp:RadioButtonList>
when I set the Repeatlayout properties to "Flow" then It render code at client side page..

<span class="clsradio" id="ctl00_cphTop_rdlCategory"><input type="radio" value="8" name="ctl00$cphTop$rdlCategory" id="ctl00_cphTop_rdlCategory_0">

<label for="ctl00_cphTop_rdlCategory_0">category1</label> <input type="radio" value="11" name="ctl00$cphTop$rdlCategory" id="ctl00_cphTop_rdlCategory_1"> <label for="ctl00_cphTop_rdlCategory_1">category2</label> <input type="radio" value="22" name="ctl00$cphTop$rdlCategory" id="ctl00_cphTop_rdlCategory_2"> <label for="ctl00_cphTop_rdlCategory_2">category3</label> <input type="radio" value="33" name="ctl00$cphTop$rdlCategory" id="ctl00_cphTop_rdlCategory_3"> <label for="ctl00_cphTop_rdlCategory_3">category4</label> </span>

How I can set radio input checked property by passing index value OR string value..
OR How I get checked Index (eq. 1,2 etc..) of radio input button
suppose, category2 is checked=true/checked then How we get the index of the list..

Change History (2)

comment:1 Changed 12 years ago by Timmy Willison

Component: unfiledmisc
Owner: set to anonymous
Priority: undecidedlow
Status: newpending

Thanks for taking the time to contribute to the jQuery project! I'm having trouble understanding this issue. Is this an issue with asp output?

To set checked to true, you can do .prop('checked', true) or .attr('checked', 'checked') or .attr('checked', true). The first is preferred.

comment:2 Changed 12 years ago by trac-o-bot

Resolution: invalid
Status: pendingclosed

Because we get so many tickets, we often need to return them to the initial reporter for more information. If that person does not reply within 14 days, the ticket will automatically be closed, and that has happened in this case. If you still are interested in pursuing this issue, feel free to add a comment with the requested information and we will be happy to reopen the ticket if it is still valid. Thanks!

Note: See TracTickets for help on using tickets.