How do I start with the drop down list disabled?

<head>

<script type="text/javascript">
function makeDisable()
{
    var x=document.getElementById("mySelect")
    x.disabled=true
}
function makeEnable()
{
    var x=document.getElementById("mySelect")
    x.disabled=false
}

</script>
</head>
<body>

 <select id="mySelect">
 <option>Apple</option>
 <option>Banana</option>
 <option>Orange</option>
 </select>

<br />

<input type='radio' name='campustype' value='in' onclick="makeDisable()" checked='1' /><label for='incampus'>In-campus</label><br />

<input type='radio' name='campustype' value='off' onclick="makeEnable()" /><label for='offcampus'>Off-campus</label>



</body>
</html>

Recommended Answers

All 2 Replies

function onLoad()
{
  makeDisable();
}

<body onload="onLoad();">
...
</body>

Should do the trick...

Ryan

Thanks

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.