lundi 16 mai 2016

How to enable/disable checkbox with radio button?

I am developing one web application where i need to disable/enable check box based on selecting radio button as show below.

<sctipt>

    function metaboliteenable() {
        document.getElementById("XT").disabled=false;
    }
    function metabolitedisable() {
        document.getElementById("XT").disabled=true;
    }
</script>


<input type="radio" name="gender" value="other"> Data<br>
    <select id="XT">
            <option value="volvo">Volvo</option>
            <option value="saab">Saab</option>
            <option value="mercedes">Mercedes</option>
            <option value="audi">Audi</option>
    </select> 

But i above code how can i link radio button with check box?

Aucun commentaire:

Enregistrer un commentaire