www.webdeveloper.com
Results 1 to 3 of 3

Thread: [RESOLVED] Hiding and showing elements javascript

  1. #1
    Join Date
    Jul 2012
    Posts
    2

    resolved [RESOLVED] Hiding and showing elements javascript

    I am using the following to hide and show two forum elements. When their respective radio button are selected. However it's not working. I don't know why the elements are not dissapearing, sorry for my naiveness in the area. I am new at this. Any help is greatly appreciated.

    The url to the page is: http://nctietheknot.com/rsvp.html

    The javascript used is below:
    Code:
    window.onload = function(){
    	document.getElementById('ind').checked = true;
    	setInterval(check, 1000);
    };
    
    function check(){
    	if(document.getElementById('fam').checked){
    		openObject('family');
    		closeObeject('individual')
    	}else{
    		openObject('individual');
    		closeObeject('family');
    	}
    }
    
    function closeObject(someID) 
    { 
    document.getElementById(someID).style.display = 'none'; 
    } 
    function openObject(someID) 
    { 
    document.getElementById(someID).style.display = 'block'; 
    }

  2. #2
    Join Date
    May 2006
    Location
    Somewhere behind your screen
    Posts
    1,633
    are you sure that this code doesn't work? for me it worked in IE,FF and Opera
    xxx: Guess Buddhist riddle: "What is the sound of one hand clapping?"
    yyy: facepalm

  3. #3
    Join Date
    Jul 2012
    Posts
    2
    It's working right now...I just used the onclick function in javascript and it finally worked. The code above should have worked, but it didn't for me atleast.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles