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:
Here is the code for the radio buttons: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 that the input fields are in: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>
Any help with making this work in Internet Explorer would be appreciated.Code:<div id="something3" style="display: block;">


Reply With Quote

Bookmarks