I have a select tag that when either of the last two options are selected, another div appears. As I research the internet, supposedly the “onchange” handler is supposed to work, but the only one that has is the “onclick” handler, which only worked in Firefox. Here’s the code:
[CODE]<select name=”referral” id=”referral”>
<option onchange=”document.getElementById(‘other_field’).style.display=’none’;”>Please select…</option>
<option value=”Ad” onchange=”document.getElementById(‘other_field’).style.display=’none’;”>Ad</option>
<option value=”Phone Book” onchange=”document.getElementById(‘other_field’).style.display=’none’;”>Phone Book</option>
<option value=”Friend or Relative” onchange=”document.getElementById(‘other_field’).style.display=’block’;”>Friend or Relative</option>
<option value=”Other” onchange=”document.getElementById(‘other_field’).style.display=’block’;”>Other</option>
</select>
<div style=”display:block;margin-left:50px;” id=”other_field” name=”other_field”>Please specify: <input name=”other” type=”text” id=”other” /></div>