I am wondering if someone might be able to help me out. All I am trying to do is come up with a light weight solution to showing and hiding divs with radio buttons. I found a solution that was working with all browsers until I tested it on IE 6 and 7. Neither of those browsers work but IE 8 does work. I know it is just something small and stupid I am overlooking...could someone please help me out. Below is some of the code I am using...
HTML Code:
<script type="text/javascript" src="js/datepicker.js"></script>
<link href="datepicker.css" rel="stylesheet" type="text/css" />
<script type=""text/javascript>
function display_div(show){
document.getElementById(show).style.display = "";
}
function hide_div(hide){
document.getElementById(hide).style.display = "none";
}
function showMe(id) { // This gets executed when the user clicks on the checkbox
var obj = document.getElementById(id);
if (obj.style.display=="none") { // if it is checked, make it visible, if not, hide it
obj.style.display = "";
} else {
obj.style.display = "none";
}
}
</script>
and then I access the the divs by this
HTML Code:
Is this an event that you will need promoted?<input type="radio" name="promo" value="" onClick="display_div('promo')" >Yes
<input type="radio" name="promo" value="" onClick="hide_div('promo')" checked="checked" >No
<div id='promo' style="display:none" >TESTING</a>
http://www.lcbcchurch.com/sites/Proj...y/request.html
Any ideas, this forum is my last hope. Please help!
|