Radio Button Name Changes

evil123

New Member
I created 2 radio buttons\[code\]<input type="radio" name="ApprovalGroup" runat="server" id="ApprovedOnly" value="http://stackoverflow.com/questions/15479827/true" />Approved<input type="radio" name="ApprovalGroup" runat="server" id="UnapprovedOnly" value="http://stackoverflow.com/questions/15479827/false" />Unapproved\[/code\]And was able to access them from js with \[code\]$("input[name=ApprovalGroup]:checked").val()\[/code\] But then I needed to add \[code\]runat="server"\[/code\] so I could access the radio button in the code behind.The problem I have is the radio button name is being changed because of the content place holder. I'm using \[code\]ClientIDMode="Static"\[/code\] but it only protects the id value, not the name. The radio button is rendered as \[code\]<input value="http://stackoverflow.com/questions/15479827/true" name="ctl00$cphContent$ApprovalGroup" type="radio" id="ApprovedOnly" />Approved<input value="http://stackoverflow.com/questions/15479827/false" name="ctl00$cphContent$ApprovalGroup" type="radio" id="UnapprovedOnly" />Unapproved\[/code\]Is it possible to prevent the name from changing?
 
Back
Top