I have a selectbox, name=h_location_id.
values: 1,2,3...10, 'other'
I have a text box, name=h_location_name , starts off disabled.
Now when the option OTHER is selected in the selectbox I want to enable the text box.
Anyone?
ps just for illustration this is the code i had tried to put together myself which wasnt working at all:
Code: Select all
<script type="text/javascript">
<!--
window.onload = function start() {
document.forms[0].h_location_name.disabled = true;
}
//getSelect(document.forms[0].h_location_id)
function chgtx(a) {
if (a == 'other') {
document.forms[0].h_location_name.disabled = false;
}
}
// -->
</script>
<select name='h_location_id' onchange='chgtx(javascript:this.value);'>
<option value='1'>1</option>
<option value='2'>2</option>
.
.
.
<option value='other'>Other</option>
</select>