Link to home
Start Free TrialLog in
Avatar of bootneck2222
bootneck2222

asked on

Activiate a textbox on dropdown selection not working in IE8

Hi,

I need to get a form to activate a textbox based on a dropdown selection. I found the below script which works fine on Firefox, Chrome and IE9+, but will not work on IE8.

Script:

<html>
<head>
<script type="text/javascript">
function checkvalue(val)
{
    if(val==="others")
       document.getElementById('color').style.display='block';
    else
       document.getElementById('color').style.display='none'; 
}
</script>
</head>
 
<body>

<select name="color" onchange='checkvalue(this.value)'> 
    <option>pick a color</option>  
    <option value="red">RED</option>
    <option value="blue">BLUE</option>
    <option value="others">others</option>
</select> 
<input type="text" name="color" id="color" style='display:none'/>
 
</body>
 
</html>

Open in new window


I would like this to work in IE8. Any assistance would be greatly appreciated.

Thank you.
ASKER CERTIFIED SOLUTION
Avatar of Robert Schutt
Robert Schutt
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of bootneck2222
bootneck2222

ASKER

Thank you Robert. I knew it would be something fairly simple.