I got this to work in NS 4, 6, and IE 5:
Code:
<html>
<body>
<form name="process">
<input type="hidden" name="payType" value="" />
Check Payment <input type="radio" name="type" value="check" onClick="check(this);" />
<br />
Credit Card Payment
<input type="radio" name="type" value="credit card" onClick="creditCard(this);" />
<br />
<br /><br /><br />
<table width="500">
<tr><td width="50%">
<div id="creditCardDiv" style="position:relative">
Credit Card Stuff
</div>
</td><td>
<div id="checkDiv" style="position:relative">
Check Stuff
</div>
</td></tr>
</table>
<script type="text/javascript">
<!--
function check(obj){
obj.form.payType.value = 'check';
showIt('checkDiv');
hideIt('creditCardDiv');
obj.blur();
}
function creditCard(obj){
obj.form.payType.value = 'creditCard';
showIt('creditCardDiv');
hideIt('checkDiv');
obj.blur();
}
function showIt(id){
var obj = getLayer(id);
if (!obj) return;
if (obj.style){
obj.style.visibility = "visible";
}
else if (document.layers){
obj.visibility = "show";
}
}
function hideIt(id){
var obj = getLayer(id);
if (!obj) return;
if (obj.style){
obj.style.visibility = "hidden";
}
else if (document.layers){
obj.visibility = "hide";
}
}
function getLayer(id){
var obj = null;
if (document.getElementById) obj = document.getElementById(id);
else if (document.all) obj = document.all[id];
else if (document.layers) obj = document.layers[id];
return obj;
}
//-->
</script>
</form>
</body>
</html>
Bookmarks