473,385 Members | 1,546 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,385 software developers and data experts.

Checkbox items under a RadioButton

I have to have three RadioButtons and then under one of this RadioButton, I
need to put two checkboxes. Something like following:

O Temperature
[] Air
[] Water
O Radiaton
O Wind Velocity

The child CheckBoxes (Air and Water in above example) should become
"activated" only when the parent RadioButton (Temperature in above example)
is selected. I am just confused how to get this done.

Any example in this regard will be gratefully appreciated.

web_learner
Apr 12 '06 #1
5 1943
you can have the page postback by setting AutoPostBack="true" and
OnSelectedIndexChanged="rdo_SelectedIndexChanged"

in the server side function rdo_SelectedIndexChanged check the current value
of the radiobutton and then set the Enabled property of the checkbox to true
or false

HTH

--
Swanand Mokashi
Microsoft Certified Solution Developer (.NET) - Early Achiever
Microsoft Certified Application Developer (.NET)

http://www.dotnetgenerics.com/
DotNetGenerics.com -- anything and everything about Microsoft .NET
technology ...

http://www.swanandmokashi.com/
http://www.swanandmokashi.com/HomePage/WebServices/
Home of the Stock Quotes, Quote of the day and Horoscope web services
"Web learner" <be******@learning.edu> wrote in message
news:ue**************@TK2MSFTNGP05.phx.gbl...
I have to have three RadioButtons and then under one of this RadioButton, I
need to put two checkboxes. Something like following:

O Temperature
[] Air
[] Water
O Radiaton
O Wind Velocity

The child CheckBoxes (Air and Water in above example) should become
"activated" only when the parent RadioButton (Temperature in above
example) is selected. I am just confused how to get this done.

Any example in this regard will be gratefully appreciated.

web_learner

Apr 12 '06 #2
Aha ! I got the idea now. I tried and it works fine.
I run into another design problem. The "entire form" is posted back, which I
do not want.

How can I have only these two controls posted back? Any idea or any URLs for
me to read?

web_learner
"Swanand Mokashi" <sw***********@swanandmokashi.com> wrote in message
news:eu**************@TK2MSFTNGP02.phx.gbl...
you can have the page postback by setting AutoPostBack="true" and
OnSelectedIndexChanged="rdo_SelectedIndexChanged"

in the server side function rdo_SelectedIndexChanged check the current
value of the radiobutton and then set the Enabled property of the checkbox
to true or false

HTH

--
Swanand Mokashi
Microsoft Certified Solution Developer (.NET) - Early Achiever
Microsoft Certified Application Developer (.NET)

http://www.dotnetgenerics.com/
DotNetGenerics.com -- anything and everything about Microsoft .NET
technology ...

http://www.swanandmokashi.com/
http://www.swanandmokashi.com/HomePage/WebServices/
Home of the Stock Quotes, Quote of the day and Horoscope web services
"Web learner" <be******@learning.edu> wrote in message
news:ue**************@TK2MSFTNGP05.phx.gbl...
I have to have three RadioButtons and then under one of this RadioButton,
I need to put two checkboxes. Something like following:

O Temperature
[] Air
[] Water
O Radiaton
O Wind Velocity

The child CheckBoxes (Air and Water in above example) should become
"activated" only when the parent RadioButton (Temperature in above
example) is selected. I am just confused how to get this done.

Any example in this regard will be gratefully appreciated.

web_learner


Apr 13 '06 #3
HI,

"Web learner" <be******@learning.edu> wrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...
Aha ! I got the idea now. I tried and it works fine.
I run into another design problem. The "entire form" is posted back, which
I do not want.
Yes, that's the standard way, you could use ATLAS to have Ajax
functionality.
How can I have only these two controls posted back? Any idea or any URLs
for me to read?

You could do some manipulations in the client page using javascript , IMO it
will solve your problem fine. Add a client side handled for the checked of
the radiobutton and inside it disable/enable the checkboxes.

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
Apr 13 '06 #4
>> How can I have only these two controls posted back? Any idea or any URLs
for me to read?

You could do some manipulations in the client page using javascript , IMO
it will solve your problem fine. Add a client side handled for the
checked of the radiobutton and inside it disable/enable the checkboxes.


Any example, tutorial on the web ?
or even page of a book that I should refer for such tasks?

Thanks,

web_learner


"Ignacio Machin ( .NET/ C# MVP )" <ignacio.machin AT dot.state.fl.us> wrote
in message news:O%****************@TK2MSFTNGP04.phx.gbl... HI,

"Web learner" <be******@learning.edu> wrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...
Aha ! I got the idea now. I tried and it works fine.
I run into another design problem. The "entire form" is posted back,
which I do not want.


Yes, that's the standard way, you could use ATLAS to have Ajax
functionality.
How can I have only these two controls posted back? Any idea or any URLs
for me to read?

You could do some manipulations in the client page using javascript , IMO
it will solve your problem fine. Add a client side handled for the
checked of the radiobutton and inside it disable/enable the checkboxes.

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

Apr 13 '06 #5
Hi,
You can do this easily with Java Script. You need to add attribute eg:
rdBtn1.attributes.add("onclick", "changeStatus()")

Then in that changeStatus function, capture all the check boxes under
that category and enable/disable them.
We can pick all the check boxes by using some common naming convention
or by using table1.getElementById('xx.').all.tags("INPUT") where table1
is the table which contains all the check boxes under that radio
button.

OK..
-praveen

Apr 18 '06 #6

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

Similar topics

0
by: Ashish Shridharan | last post by:
Hi All, Has anyone ever tried disabling a checkbox or a radiobutton web server control in netscape ? While a textbox and a button control renders disabled, .NET adds the disabled attribute to...
2
by: alien2_51 | last post by:
Can some one tell me why the onclick is firing twice for the radion button and checkbox controls...? <%@ Page Language="vb" AutoEventWireup="false" Codebehind="Testing.aspx.vb"...
1
by: dx | last post by:
I'm extremely frustrated with ASP.NET...again! To me this should be as simple as setting oCheckBox.Checked = True.. yet for some reason it isn't. I have a user control (ascx) that that has a...
1
by: sneha123 | last post by:
There will be some 20 questions and for each question there will be 4 choices.what i want to do is to select multiple answers by clicking the checkbox. i m using asp.net,vb.net pls help me we...
2
by: Hari | last post by:
Is there a way in VB.Net where you can group a bunch of checkboxes together so at all times a maximum of 1 checkbox is selected? I'm really new to VB, but I have Visual Studio. Do I use the...
3
by: newjazzharmony | last post by:
Hello group, I want to automatically select a specific checkbox when a user clicks (selects) a specific item in a radiobutton group. Both controls are in the same form. Let's say for...
5
by: Web learner | last post by:
I have to have three RadioButtons and then under one of this RadioButton, I need to put two checkboxes. Something like following: O Temperature Air Water O Radiaton O Wind Velocity The...
3
by: Pope Pius X2 | last post by:
I have a simple php form that is submitted and the details are emailed to someone. The problem is that there is a checkbox and if the checkbox is clicked then it sends the result as "Yes". However...
0
by: Nathan Sokalski | last post by:
In the RadioButton and CheckBox controls, there is no Value attribute. The html <inputtag has a value attribute, which is used by both type="radio" and type="checkbox". The RadioButtonList and...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
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:
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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.