Solved

RadioButton Group

Posted on 2014-07-25
3
329 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 33

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

Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
This article discusses four methods for overlaying images in a container on a web 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 …
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

777 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