Solved

RadioButton Group

Posted on 2014-07-25
3
330 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 83

Accepted Solution

by:
Dave Baldwin earned 500 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 83

Expert Comment

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

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
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 style a decorative dropcap for the first letter in a paragraph using CSS. In CSS, create a new paragraph class by typing "p.fancy": Then, to style only the first letter of the first sentence, include the ps…
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…

821 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