Perhaps something like this:
HTML Code:
<form action="" onsubmit="return false;">
<p>Choice:
<select size="1" name="choice"
onchange="return checkControls(this, other)">
<option>[select one]</option>
<option>apples</option>
<option>bananas</option>
<option>cantaloupe</option>
</select><br>
Other:
<input type="text" name="other" size="20"
onchange="return checkControls(choice, this)"></p>
</form>
<script type="text/javascript">
<!--//
function checkControls(sel, txt) {
if(sel.selectedIndex < 1) {
txt.disabled = false;
if(/^\s*$/.test(txt.value)) {
sel.disabled = false;
} else {
sel.selectedIndex = 0;
sel.disabled = true;
}
} else {
txt.value = "";
txt.disabled = true;
}
return true;
}
//-->
</script>
Bookmarks