473,545 Members | 4,917 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Determining chosen radio button?

Is there an easy way to determine which radio button in a
group has been chosen, besides having to put code in the
checkchanged or clicked event for each button in the
group...???

thanks,

vince
Nov 15 '05 #1
1 33791
You can just put handle the CheckChanged event of the entire group.

radiobtn.CheckC hanged (this would be the method)

And then in that method do something like this to see if it is checked:

void CheckChanged(ob ject sender, EventArgs e)
{
RadioButton radioBtn = (RadioButton) sender;

if (radioBtn.Check ed)
{
MessageBox.Show ("Radio Button: " + radioBtn.Text + " is checked");
} // if (radioBtn.Check ed)
}// void CheckChanged(ob ject sender, EventArgs e)

This should work for you. You may have to check exact sytax since I just
typed this up quick from memory.

Jared Baszler
"vince" <vl******@sdcer a.org> wrote in message
news:01******** *************** *****@phx.gbl.. .
Is there an easy way to determine which radio button in a
group has been chosen, besides having to put code in the
checkchanged or clicked event for each button in the
group...???

thanks,

vince

Nov 15 '05 #2

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

Similar topics

2
7533
by: Renie83 | last post by:
Hi all! I was wondering does anyone have any ideas on how I can send info to a SQL database by choosing a radio button. What I want to do is set one radio button to "Max" and one to type "Avg". When a user clicks on a radio button I want the value of whatever button was chosen to be placed inside the "type" field in my database after they hit...
0
1660
by: ana_gil | last post by:
Hello I need help whit a validation control. I have a radio button list which i made required: <asp:radiobuttonlist id="_AlergiasSN" runat="server"> <asp:listitem id="_AlergiasS" runat="server" value="Yes" /> <asp:listitem id="_AlergiasN" runat="server" value="No" /> </asp:radiobuttonlist>
4
11498
by: lemat | last post by:
Hi, I use a radio button form in which users can select a color by clicking on a image. I would like this image to change to another one when it's chosen. (image with a "Chosen" Stamp in the middle) Of course I like it to be restored if hte user select another color. I've tried to add behaviour to the image (swap on click) and on the...
2
2604
by: newfie912 | last post by:
I have an online application used for grading students. On one of the pages, I have a table with two rows and each row has 16 cells. The upper row contains the letter grade (A, A-, B+, B, etc) and the lower row has a 16 radio buttons for selecting the appropriate grade. This all writes to a SQL server back-end and has been working fine for...
1
2398
by: Para | last post by:
Hi , I am working on a project using C/C++ in linux environment. Our program right now using the command line(console window) inputs and starts executing. command on console are to start program is, ./exe Please enter the selections( displays 1to 6 options) if either of them selected the program starts.
1
1611
by: Visual77 | last post by:
I'm trying to set up a script that checks to see how many radio buttons are set to Yes and how many are set to No. I'm using PHP to generate all the radio buttons and name them, and as it goes through, it gives each one a numeric ID based on the order, and a name which is equal to what the option is for. At the end of the field, I have the...
3
3957
by: Thad | last post by:
On one page I have radio buttons below pictures, here is one picture... <img src="images/web-aroundworld458c.jpg" width="100" height="51" border="0" onclick="this.src='./images/web-aroundworld458c.jpg';this.height=102;this.width=200" ondblclick="this.src='./images/web-aroundworld458c.jpg';this.height=51;this.width=100" alt="" /><br />...
3
2774
by: camdev | last post by:
I have a form with 2 radio buttons and multiple checkboxes (see example below). The one radio button indicates all and the other radio button indicates the user has chosen specific options (checkboxes) from a list. Can I use javascript to automatically select the 2nd radio button if the users clicks on any of the checkboxes? <form name=form1>...
0
1261
by: Ellyyra | last post by:
I am trying to make a 'Character Generator' for a website. In the first page they are asked for three pieces of information each with a group of radio buttons; Gender-Male, Female; HairColour-Black, Blonde, Brown, Grey, Orange, White; ClothingColour- Red, Yellow, Pink, Green, Purple, Orange, Blue. Once they have selected an option and click...
0
7656
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
5968
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5323
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4943
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3449
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3440
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1874
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1012
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
700
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.