View Full Version : Resolved JS not working properly in IE

07-29-2009, 12:55 AM
I have a radio group that, when a certain option is selected, it makes the radio group disappear and a textbox appear. It works great in Firefox, but it appears to be glitchy in IE. Any ideas?

<script type="text/javascript">
function showRestaurantTextBox()
document.getElementById("restauranttxt").style.display = "Block";
document.getElementById("specifyRestaurant").style.display = "None";
<div id="specifyRestaurant">
<input name="radio" type="radio" id="checkAll" value="checkAll" checked="checked" />
All Restaurants
<input type="radio" name="radio" id="checkSpecify" value="checkSpecify" onchange="javascript:showRestaurantTextBox()" />
<input type="text" name="restaddrestaurant" id="restauranttxt" style="border:#868687 1px solid;display:none" value="<?php echo $input1; ?>" autocomplete=off />
<div id="restsuggest" style="visibility:hidden;border-left:#000000 1px solid;border-bottom:#000000 1px solid;border-right:#000000 1px solid;width:149px;"></div>

07-29-2009, 01:13 AM
Don't use onchange since it doesn't fire in I.E. until the element loses focus; use onclick. Also you can replace javascript: with nothing.