Give your select box and
id. For example:
- Code: Select all
<select id="myselect">
..Now if you're done giving it an id, give your
input box and
id too. Example would be:
- Code: Select all
<input type="text" disable="disable" id="myinput">
...Now when you're finished doing thosse, you need to decide when you want the even to trigger..either
onchange (option box is change) or
onclick (triggered by a button).
If you want the earlier, then this code would suffice, using the id's i've given as example.
- Code: Select all
window.onload=function()
{
var select=document.getElementById('myselect');
var inps=document.getElementById('myinput');
select.onchange=function()
{
switch(select.value)
{
case 'others':
inps.disabled=false;
break;
}
}
}
Note that your other's option box value should be
others, or else, change this part to what your value is:
- Code: Select all
case 'others':
IF you want an event triggered via
onclick, don't hesitate to come back.
See if it helps
