Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
Show/Hide div with radio buttons
Old 05-12-2009, 04:13 PM Show/Hide div with radio buttons
Junior Talker

Posts: 1
Name: Nate Hamilton
Trades: 0
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!
nate8684 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 05-13-2009, 08:56 AM Re: Show/Hide div with radio buttons
wayfarer07's Avatar
Poo on You

Latest Blog Post:
Introducing WowWindow
Posts: 3,987
Name: Abel Mohler
Location: Asheville, North Carolina USA
Trades: 0
<script type=""text/javascript>

should be

<script type="text/javascript">

note the position of the quotes
__________________
I build web things. I work for the startup
Please login or register to view this content. Registration is FREE
.
wayfarer07 is offline
Reply With Quote
View Public Profile Visit wayfarer07's homepage!
 
Reply     « Reply to Show/Hide div with radio buttons
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.10032 seconds with 12 queries