views:

56

answers:

1
Male <input value="V1" checked="checked" name="R1" type="radio">
Female: <input name="R1" value="V2" type="radio"></p>


<input name="C1" value="ON" type="checkbox">Reading 
<input name="C2" value="ON" type="checkbox">Dressing 
<input name="C3" value="ON" type="checkbox">Make up
<input name="C4" value="ON" type="checkbox">Playing 

Just consider the situation like :

here MAle radio button is checked . I want check box Reading and playing Should be automatically checked < Default or >

Suppose Female checked - Make up and dressing

I want to check automatically

+2  A: 
    function select_radio(val){
      if (val=="male"){
    document.getElementById("C1").checked = true;
    document.getElementById("C2").checked = true;
    document.getElementById("C3").checked = false;
    document.getElementById("C4").checked = false;
      }
      else{
    document.getElementById("C3").checked = true;
    document.getElementById("C4").checked = true;
    document.getElementById("C1").checked = false;
    document.getElementById("C2").checked = false;
      }



    }


Male <input value="V1" checked="checked" name="R1" type="radio" onclick="select_radio('male')">
Female: <input name="R1" value="V2" type="radio" onclick="select_radio('female')">></p>


<input name="C1" id="C1"  value="ON" type="checkbox">Reading 
<input name="C2" id="C2"  value="ON" type="checkbox">Dressing 
<input name="C3" id="C3" type="checkbox">Make up
<input name="C4" id="C4" type="checkbox">Playing 
Salil