Click to See Complete Forum and Search --> : Textcolor


Sonia
07-24-2003, 09:08 AM
In the following code, how can I change the textcolor in the Others textbox.


Code:


<html>
<head>
<script>
function other()
{
if(document.frm.country.selectedIndex == 2)
{
document.frm.oth.disabled = false;
document.getElementById('oth').style.background='white';
document.getElementById('oth').style.foreground='blue'; //change the textcolor
document.frm.oth.focus()
}
else
{
document.frm.oth.disabled = true;
document.getElementById('oth').style.background='#cccccc';
}
}


</script>
</head>
<body>
<form name = "frm">
<select name = "country" onChange = "other()">
<option value = "Mrt">Mauritius
<option value = "India">India
<option value = "Others">
<br>
<br>
Other <input type=text name="oth" id="oth" disabled style = "background-color='#cccccc'">
</form>
</html>

pyro
07-24-2003, 09:09 AM
document.getElementById('oth').style.foreground='blue'; //change the textcolor

needs to be

document.getElementById('oth').style.color='blue'; //change the textcolor