Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2003
    Location
    Chennai
    Posts
    11

    Unanswered: Javascript help - challenging!!

    I need to write a javascript function with onClick() for the radio button or checkbox. I have a situation in which :
    1. I should be able to select select a group of radiobuttons if their parent radio button is selected
    2. I should be able to select a single radio button from only one group.

    Example:
    <input type="radiobutton" name="parentA"> ...
    <input type="radiobutton" name="childA1"> ...
    <input type="radiobutton" name="childA2"> ...

    <input type="radiobutton" name="parentB"> ...
    <input type="radiobutton" name="childB1"> ...
    <input type="radiobutton" name="childB2"> ...
    <input type="radiobutton" name="childB3"> ...
    ...


    If the radiobutton corresponding to "parentA" is clicked then all "childA1", "childA2" should be selected.

    If user has selected "childA1" and then if he clicks "childB1", then "childA1" has to deselected and "childB1" has to selected.


    Can any one help me in this regard?


    Thanks in advance
    Navanee
    Last edited by rnavanee; 08-06-03 at 07:49.

  2. #2
    Join Date
    Aug 2003
    Location
    Bologna - Italy
    Posts
    209
    You should look at the disabled and/or readOnly attributes of the element you want to disable or render read only:

    document.forms[0].elements["childA1"].disabled=true;

    Bye!
    The only failure is not trying to do it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •