- Code: Select all
<select name="Hearaboutus" onchange="change()" id="choose">
<option value="pleasechoose">Please choose</option>
<option value="Friend">Friend</option>
<option value="Real estate agent"> Real estate agent</option>
<option value="Search engine"> Search engine</option>
<option value="Sign"> Sign</option>
<option value="Flyer"> Flyer</option>
<option value="Business card"> Business card</option>
<option value="Direct mail"> Direct mail</option>
<option value="Other"> Other </option></select>
If they select "other" I want:
- Code: Select all
<tr valign="top" id="ifother">
<td align="right" >If other please explain.</td>
<td align="left"><input type="text" name="whoisother" value="" maxlength="100" size="30"></td>
</tr>
to appear. I've got some Idea of how to do this ... for example:
- Code: Select all
<script type="text/javascript">
window.onload = function()
{ //line51
document.getElementById("change").style.display='none';
}
function change()
{
switch (document.getElementById("choose").value)
{
case "Friend":
document.getElementById("ifother").style.display='none'
break;
case "Real estate agent":
document.getElementById("ifother").style.display='none'
break;
case "Sign":
document.getElementById("ifother").style.display='none'
break;
case "Other":
document.getElementById("ifother").style.display=''
break;
}
}



