473,383 Members | 1,918 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

Best use of RadioButtons

In html and ASP, I would easily code radio buttons as needed, such as:

<input type="radio" name="question1" value="1">1</input>&nbsp;
<input type="radio" name="question1" value="2">2</input>&nbsp;
<input type="radio" name="question1" value="3">3</input>

If I use the <asp:radiobuttoncontrol, I can do this:

<asp:RadioButton ID="RB1" GroupName="question1" runat="server" />1
<asp:RadioButton ID="RB2" GroupName="question1" runat="server" />2
<asp:RadioButton ID="RB3" GroupName="question1" runat="server" />3

My problem with this is that I can't specify a value. When the form is
filled out, I need a value between 1 and 5 to be inserted into the
database. In the above example, the value is actually whatever the ID is
and since I can't have duplicate IDs, then that rules out the use of
<asp:RadioButton />.

The <asp:radiobuttonlist /would probably work ok but I can't place the
radio buttons (the <asp:listitem />) side by side. It only puts the
radio buttons vertically.

<asp:RadioButtonList ID="RBL1" runat="server">
<asp:ListItem>1</asp:ListItem>
<asp:ListItem>2</asp:ListItem>
<asp:ListItem>3</asp:ListItem>
</asp:RadioButtonList>

Looking at the source after the page is rendered, I can see that it
creates a table to display the radiobuttons. The value is present
though, which is what I would need for my database.

I was hoping to not use <inputtags this time around and use more
'advanced' coding techniques, but I don't know how I would go about
using server controls considering my display and value requirements.

Any input would be appreciated.

TIA,
Jim
Sep 8 '06 #1
0 885

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: discomiller | last post by:
Mario Mueller: Hello *, radiobuttons belong to other radiobuttons by the "name="any_value"" attribut. Thats a fakt. I got the following XML:...
0
by: Carlos | last post by:
Hi again all, I am now trying to process two groups of radiobuttons, and determine answers for a survey. While handling the submit button, I would like to know ewhat is the best way of checking...
2
by: Gummy | last post by:
Hello, I want to make a survey that reads the questions off a database and then has next to each question the appropriate answer types - yes/no; agree/somewhat agree/somewhat disagree/disagree;...
4
by: news.microsoft.com | last post by:
Hello, I have two databound radiobuttons which have advanced databinding properties of onpropertychanged enabled so that I can raise the columnchanged event whenever the radiobuttons are...
4
by: PedroVision | last post by:
I have a VB 2005 form with 140 different radiobuttons... Some are "checked", some are not... I want to reset all radiobuttons to "unchecked". I've been searching and trying differnet...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.