473,785 Members | 2,919 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1961
you can have the page postback by setting AutoPostBack="t rue" and
OnSelectedIndex Changed="rdo_Se lectedIndexChan ged"

in the server side function rdo_SelectedInd exChanged 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******@learn ing.edu> wrote in message
news:ue******** ******@TK2MSFTN GP05.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******** ******@TK2MSFTN GP02.phx.gbl...
you can have the page postback by setting AutoPostBack="t rue" and
OnSelectedIndex Changed="rdo_Se lectedIndexChan ged"

in the server side function rdo_SelectedInd exChanged 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******@learn ing.edu> wrote in message
news:ue******** ******@TK2MSFTN GP05.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******@learn ing.edu> wrote in message
news:%2******** ********@TK2MSF TNGP04.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.mach in AT dot.state.fl.us > wrote
in message news:O%******** ********@TK2MSF TNGP04.phx.gbl. .. HI,

"Web learner" <be******@learn ing.edu> wrote in message
news:%2******** ********@TK2MSF TNGP04.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.attribut es.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.getEleme ntById('xx.').a ll.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
2108
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 the span tag in the case of a checkbox or a radiobutton. Effectively, these controls are not disabled in netscape.
2
3870
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" Inherits="CustomerRelations.Testing" %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HEAD> <title>Testing</title> <!--
1
4511
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 checkbox and I can't get it to default to checked. I tried radiobuttons and experienced the same result.. can't start them as checked. The really frustrating thing is that I set the attributes of other input controls in the Init() with no problem. ...
1
2923
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 have written the code using radio button for selecting single item.but we want to replace it with checkbox to select multiple items. the code using radio button is given below .pls correct it with checkbox
2
15228
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 CheckedListBox, or what. Thanks in advance to all comments.
3
4440
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 argument's sake that the form looks like this (inessential items left out for the sake of clarity): <form name=form1>
5
1087
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 child CheckBoxes (Air and Water in above example) should become
3
4472
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 when it's not clicked I'd like the result to appear as "No" but I can't seem to do this. This is my code: <?php $radiobutton = $_REQUEST ; $select = $_REQUEST ; $textarea = $_REQUEST ; $textfield = $_REQUEST ; $textfield2 = $_REQUEST ; ...
0
1304
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 CheckBoxList controls have SelectedValue properties (I realize that the RadioButtonList uses the <selectand <optiontags instead of the <inputtag, but needing a value server-side exists either way). I am attempting to write a control with...
0
9643
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9480
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10319
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10147
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9947
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8971
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7496
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3645
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.