Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

RadioButton Group

Posted on 2014-07-25
3
Medium Priority
?
335 Views
Last Modified: 2014-07-25
The attached image shows some buttons put in a panel control.

Question: Is it possible to modify this button assembly to behave like a set of radiobuttons?

If yes, how what are the changes I need to apply to it?

Thank you.
#btn1, #btn3, #btn5
{
     Height:30px;
     Width:103px;
     margin: 2px auto 0px auto;
}
.
.                
<panel type="radio" name="opt" ID="btnOpt"> 
      <td><asp:Button ID="btn1" Name="opt" runat="server" Text="1" TabIndex="1"   /></td>
      <td><asp:Button ID="btn3" Name="opt" runat="server" Text="3" TabIndex="3"  /></td>
      <td><asp:Button ID="btn5" Name="opt" runat="server" Text="5" TabIndex="5"  /></td>
</panel>

after I revised it to:
 <td><asp:radioButton ID="btn1"  GroupName="cmdOpt" Name="opt" runat="server" Text="1" TabIndex="1"   /></td>
 <td><asp:radioButton ID="btn3"  GroupName="cmdOpt" Name="opt" runat="server" Text="3" TabIndex="3"  /></td>
 <td><asp:Button ID="btn5"  GroupName="cmdOpt" Name="opt" runat="server" Text="5" TabIndex="5"  /></td>

Open in new window

I am getting the second image (radioButton2) where the radio button assembly is functioning but it looses css.
radioButton.png
radioButton2.png
0
Comment
Question by:Mike Eghtebas
  • 2
3 Comments
 
LVL 84

Accepted Solution

by:
Dave Baldwin earned 2000 total points
ID: 40220963
Radio buttons have a check circle beside them, not a number inside a button.  I don't think you can make it look like the first version and act like radio buttons unless you write some javascript to make that happen.
More info here: http://www.w3schools.com/html/html_forms.asp
0
 
LVL 34

Author Comment

by:Mike Eghtebas
ID: 40220970
Thanks
0
 
LVL 84

Expert Comment

by:Dave Baldwin
ID: 40221009
I don't know C#, I thought it was a javascript problem.
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…

782 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question