...

View Full Version : Resolved JS not working properly in IE



wldrumstcs
07-29-2009, 01: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";
}
</script>
<div id="specifyRestaurant">
<label>
<input name="radio" type="radio" id="checkAll" value="checkAll" checked="checked" />
All Restaurants
</label>
<label>
<input type="radio" name="radio" id="checkSpecify" value="checkSpecify" onchange="javascript:showRestaurantTextBox()" />
Specify...
</label>
</div>
<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>

randomuser773
07-29-2009, 02: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.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum