www.webdeveloper.com
Results 1 to 2 of 2

Thread: [RESOLVED] Dynamic Forms, doesnt work in IE, but does in firefox

Threaded View

  1. #1
    Join Date
    Jan 2009
    Location
    Ohio
    Posts
    1

    resolved [RESOLVED] Dynamic Forms, doesnt work in IE, but does in firefox

    I'm attempting to make a dynamic form with three different categories. When you click on a certain radio button, one of the three categories displays the corresponding input

    fields. When the person fills out the fields for the specific category, all the information is uploaded through PHP to a MySql database. When the user fails to fill out All the

    fields, an error message displays. When the radio button is clicked in firefox, everything works, the correct fields displays. But when you click a radio button in Internet

    Explorer, the fields don't change.

    Here is the main Javascript page:

    Code:
    	var ids=new Array('something','something2','something3');
    
    	function switchid(id)
    	{	
    		hideallids();
    		showdiv(id);
    	}
    
    	function hideallids()
    	{
    		for (var i=0;i<ids.length;i++)
    		{
    			hidediv(ids[i]);
    		}		  
    	}
    
    	function hidediv(id) 
    	{
    		if (document.getElementById) 
    		{
    			document.getElementById(id).style.display = 'none';
    		}
    		else 
    		{
    			if (document.layers) 
    			{ 
    				document.id.display = 'none';
    			}
    			else 
    			{
    				document.all.id.style.display = 'none';
    			}
    		}
    	}
    
    	function showdiv(id) 
    	{
    		
    		if (document.getElementById) 
    		{ 
    			document.getElementById(id).style.display = 'block';
    		}
    		else 
    		{
    			if (document.layers) 
    			{ 
    				document.id.display = 'block';
    			}
    			else 
    			{ 
    				document.all.id.style.display = 'block';
    			}
    		}
    	}
    Here is the code for the radio buttons:

    Code:
    something:<a href="javascript:switchid('something');"><input type="radio" name = "payment" value ="something" /></a>
    something2: <a href="javascript:switchid('something2');"><input type="radio" name = "payment" value ="something2" /></a>
    something3:<a href="javascript:switchid('something3');"><input type="radio" name = "payment" value ="something3" /></a>
    Here is the code that the input fields are in:

    Code:
    <div id="something3" style="display: block;">
    Any help with making this work in Internet Explorer would be appreciated.
    Last edited by xtjx09; 01-07-2009 at 01:05 PM.

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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