Has anyone ever used the FIELDSET in conjunction with a checkbox and some javascript to "hide" fields? ... for example, if the checkbox is unchecked, the data doesn't show ... and if it's checked, it does. Well, I've got that park working fine.
The issue I'm having is if the person filling out the form advances to the next page and then has to go back to the previous page to change something. At that point, the FIELDSET tag isn't playing well. The checkbox is still checked, but the "hidden" fields aren't displayed ... they're hidden again. If you UNCHECK the checkbox, the fields come into view. I need for the data to be displayed if the box is checked ... any ideas? Perhaps some kind of javascript checking??
Thanks!!
~Michael
Here's a sample of my code ...
The issue I'm having is if the person filling out the form advances to the next page and then has to go back to the previous page to change something. At that point, the FIELDSET tag isn't playing well. The checkbox is still checked, but the "hidden" fields aren't displayed ... they're hidden again. If you UNCHECK the checkbox, the fields come into view. I need for the data to be displayed if the box is checked ... any ideas? Perhaps some kind of javascript checking??
Thanks!!
~Michael
Here's a sample of my code ...
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled</title>
<style>
.hidden
{
TEXT-DECORATION: none;
COLOR: #000000;
DISPLAY: none
</style>
<SCRIPT language=javascript>
<!--
function addDNS() {
var add_DNS = document.all.ADD_DNS
if (add_DNS.style.display == 'block'){
add_DNS.style.display='none'
}
else
add_DNS.style.display='block'
}
--></SCRIPT>
</head>
<body>
<FIELDSET style="width: 95%"><LEGEND>WHAT DO YOU WANT TO DO?</LEGEND>
<TABLE cellSpacing=0 cellPadding=0 border=0><TBODY>
<TR>
<TD>
<INPUT TYPE="checkbox" NAME="WHICH_FORM" VALUE="ADD_DNS" onClick="addDNS();">
Add a new DNS entry<BR>
</TD>
</TR>
</TBODY></TABLE>
<FIELDSET class=hidden id=ADD_DNS style?padding-right:100? style="width: 95%">
<LEGEND>WHAT TYPE OF DNS ENTRY DO YOU WANT TO CREATE?</LEGEND>
<TABLE><TBODY>
<TR>
<TD>
<INPUT TYPE="checkbox" NAME="ADD_DNS_RECORD" VALUE="New_DNS_Name" onClick="NewDNS();">New DNS Name<BR>
<INPUT TYPE="checkbox" NAME="ADD_DNS_RECORD" VALUE="PTR_Only" onClick="PTRDNS();">Reverse lookup (PTR record) for an existing DNS name<BR>
<INPUT TYPE="checkbox" NAME="ADD_DNS_RECORD" VALUE="CNAME" onClick="ALIAS();">Alias (CNAME record) for an existing DNS name<BR>
</TD>
</TR>
</TBODY></TABLE>
</FIELDSET>
</body>
</html>