Checkbox items under a RadioButton

Discussion in 'ASP .Net Web Controls' started by Web learner, Apr 12, 2006.

  1. Web learner

    Web learner Guest

    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
     
    Web learner, Apr 12, 2006
    #1
    1. Advertising

  2. 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" <> wrote in message
    news:...
    >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
    >
    >
     
    Swanand Mokashi, Apr 12, 2006
    #2
    1. Advertising

  3. Web learner

    Web learner Guest

    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" <> wrote in message
    news:...
    > 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" <> wrote in message
    > news:...
    >>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
    >>
    >>

    >
    >
     
    Web learner, Apr 13, 2006
    #3
  4. HI,

    "Web learner" <> wrote in message
    news:%...
    > 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
     
    Ignacio Machin \( .NET/ C# MVP \), Apr 13, 2006
    #4
  5. Web learner

    Web learner Guest

    >> 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%...
    > HI,
    >
    > "Web learner" <> wrote in message
    > news:%...
    >> 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
    >
     
    Web learner, Apr 13, 2006
    #5
  6. Web learner

    Guest

    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, 2006
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. bruce barker

    Re: Checkbox and Radiobutton onfocus events

    bruce barker, Jul 23, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    1,208
    bruce barker
    Jul 23, 2003
  2. alien2_51
    Replies:
    2
    Views:
    3,966
  3. Abhishek Srivastava

    Assign ID to a radiobutton inside a checkbox

    Abhishek Srivastava, Feb 5, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    1,065
    Alvin Bruney [MVP]
    Mar 2, 2004
  4. Leo J. Hart IV
    Replies:
    5
    Views:
    4,178
    Leo J. Hart IV
    Oct 10, 2004
  5. Web learner

    Checkbox items under a RadioButton

    Web learner, Apr 12, 2006, in forum: ASP .Net
    Replies:
    5
    Views:
    618
Loading...

Share This Page