Click to See Complete Forum and Search --> : radio button in form fails in Netscape 7.0


mike444
03-03-2003, 12:52 PM
I have a form that works fine in IE but when in netscape 7.0 a radio button labelled "Specified Date" fails to make three text boxes labelled "month", 'day", and "year" appear when clicked. The form also doesn't send in netscape either but I think that's just because I don't have an e-mail account with netscape yet (not sure). Anyway I'm not sure what the compatibility issue is on the radio button...anyone know? I included the form page:


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML>
<HEAD>
<TITLE>My First Stylesheet</TITLE>
<STYLE TYPE="text/css">
<!--
table a:link, a:visited, a:active {text-decoration: none;}
a:link {color:white;}
a:visited {color:white; text-decoration: none}
a:hover {color:black; background:orange; text-decoration: none}
a:active {color:white; background:red; text-decoration: none}
H1 { white-space : nowrap; color: white; font-size: 50px; font-family: impact; line-height: 45px }

H2 { white-space : nowrap; text-indent: 10px; position: justify; left:1px; top: 1px; color: green; font-size: 15px; font-weight: bold; font-family: arial; line-height: 19px; }

i { color: white; font-size: 15px }
#m { white-space : nowrap; color: yellow; font-size: 10px; font-weight: bold; font-family: arial }
#t { white-space : nowrap; color: yellow; font-size: 12px; font-weight: bold; font-family: arial }
H3 { white-space : nowrap; text-indent: 10px; position: justify; left:1px; top: 1px; color: yellow; font-size: 15px; font-weight: bold; font-family: arial; line-height: 19px; }
H4 { text-indent: 10px; position: justify; left:1px; top: 1px; color: yellow; font-size: 15px; font-weight: bold; font-family: arial; line-height: 19px; }
H5 { text-indent: 10px; position: justify; left:1px; top: 1px; color: yellow; font-size: 15px; font-weight: bold; font-family: arial; line-height: 19px; }
-->
</STYLE>
<script type="text/javascript">

function showIt() {
document.Main.quantity.style.visibility="visible";
}
function hideIt() {
document.Main.quantity.style.visibility="hidden";
}

function showIt2() {
document.all.Date.style.visibility="visible";
}
function hideIt2() {
document.all.Date.style.visibility="hidden";
}


</script>
</HEAD>
<BODY BGCOLOR="#000000">
<H1><a href="C:\My Documents\blahblaform.html">SITENAME.COM</a>
<H2>THIS IS THE BLAH BLA PURCHASE PAGE. PLEASE FILL OUT THE FOLLOWING:</H2>
<br>
<form name="Main" method=post action="mailto:trat444@yahoo.com" enctype="text/plain"><H3>YOUR NAME:&nbsp;<input type="text" name="sender name">&nbsp;&nbsp;YOUR E-MAIL:&nbsp;<input type="text" name="sender e-mail"></H3>
<H3>BLAH BLA RECIPIENT'S NAME:&nbsp;<input type="text" name="recipient's name"></H3>
<H3>BLAH BLA RECIPIENT'S E-MAIL:&nbsp;<input type="text" name="recipient's e-mail"></H3>
<H3>THE AMOUNT OF THE BLH BLA:&nbsp;<input type="text" size="7" name="amount of blah bla">&nbsp;<span id="t"><t>(any lorum ipsum text)</t></span></H3>
<H3>THE TYPE OF BLAH BLA:</H3>
<H3><input type="radio" name="blah bla type" value="lorumipsum1">&nbsp;LORUMIPSUM1&nbsp<span id="t"><t>(irrelevent text)</t></H3>
<H3><input type="radio" name="blah bla type" value="lorumipsum2">&nbsp;LORUMIPSUM2&nbsp<span id="t"><t>(can be lorum ipsum)</t></H3>
<H3><input type="radio" name="blah bla type" value="lorumipsum3">&nbsp;LORUMIPSUM3&nbsp<span id="t"><t>(more text lorumipsum)</t>
<br><span id="t"><t>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*Long line of irrelavent text. Blah bla yada yada yada yada. Lorumipsum ipsumlorum lorum ipsum yadayadayadayda.</t></span></H3>
<H3>NUMBER OF DAYS:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SINGLE DAY&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MULTI DAY&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MULTI DAY QUANTITY</H3>
<H3>

<span id="m"><m>(LORUM IPSUM)</m></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" name="number of days" value="single" onclick="hideIt()">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" name="number of days" value="multi" onclick="showIt()">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" name="quantity" style="visibility: hidden" size="3">
</H3>
<H4>Another long line of insignificant text. Lorumipsum ipsum lorum lorumipsum. Yada yada yada yada yada yada.<br>&nbsp;&nbsp;&nbsp;sent to the blah bla recipient as part of the blah or returned to your blah bla account?</H4>
<H3>
<input type="radio" name="balance destination" value="to recipient">Sent to the blah bla recipient.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="radio" name="balance destination" value="returned to sender">Returned to my blah bla account.
</H3>
<H3>When would you like the blah bla notification sent to the blah bla recipient?</H3>
<H3>
<input type="radio" name="Daterad" value="immediately" onclick="hideIt2()">&nbsp;IMMEDIATELY</H3>
<H3><input type="radio" name="Daterad" value="specified date" onclick="showIt2()">&nbsp;SPECIFIED DATE


<div id="Date" style="visibility: hidden">
Month:&nbsp;
<input type="text" name="month" size="2">&nbsp;&nbsp;&nbsp;&nbsp;
Day:&nbsp;
<input type="text" name="day" size="2">
&nbsp;&nbsp;&nbsp;&nbsp;
Year:&nbsp;
<input type="text" name="year" size="4"></div>

<H5>
If you would like to include a personal message with the blah bla notification you may type it in the box
<br>&nbsp;&nbsp;provided below and then click enter. Otherwise you may click enter now.
</H5>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<TEXTAREA NAME="COMMENTS" ROWS=5 COLS=40 WRAP="hard">
</TEXTAREA>
<br><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<INPUT TYPE="submit" VALUE="ENTER">
<INPUT TYPE="reset" VALUE="RESET"></form></body></html>

khalidali63
03-03-2003, 02:59 PM
There are differences the way an object is referenced between IE and NS,
The code you had did not implemented NS oriented code

I have made the requred changes to JavaScript code.Replace the code with the code snippet below

Cheers

Khalid

<script type="text/javascript">
function showIt() {
var obj = document.getElementById("quantity")
obj.style.visibility="visible";
}
function hideIt() {
var obj = document.getElementById("quantity")
obj.style.visibility="hidden";
}

function showIt2() {
var obj = document.getElementById("Date")
obj.style.visibility="visible";
}
function hideIt2() {
var obj = document.getElementById("Date")
obj.style.visibility="hidden";
}
</script>

mike444
03-03-2003, 03:16 PM
well, that fixed the "Specified date" radio button (Thank you) but now the text box that is supposed to appear when the "Multi Day" radio button is clicked isn't appearing. I checked to make sure the right text input name was in there and it looks okay. Still works fine in IE, though.

khalidali63
03-03-2003, 03:25 PM
oops I thought everything had an id..

these are referenced by form element names..

in the javascript tags replace the first 2 functions with these


function showIt() {
var obj = document.Main.quantity;
obj.style.visibility="visible";
}
function hideIt() {
var obj = document.Main.quantity;
obj.style.visibility="hidden";
}



Cheers

Khalid

mike444
03-04-2003, 04:17 PM
Originally posted by khalidali63
oops I thought everything had an id..

these are referenced by form element names..

in the javascript tags replace the first 2 functions with these


function showIt() {
var obj = document.Main.quantity;
obj.style.visibility="visible";
}
function hideIt() {
var obj = document.Main.quantity;
obj.style.visibility="hidden";
}



Cheers

Khalid

Thanks, Khalid. It's working correctly now. :)