473,407 Members | 2,676 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

Javascript won't run in IE 6...

I've ran out of debugging ideas. If anyone knows why this won't run in IE 6 please let me know. It works fine in Fire Fox 2.0.0.3 and Netscape (version unknown). I suspect there is something basic about IE and Javascript that I'm wholly unaware of. I've edited the HTML code to include just the essential elements because it exceeded the allowed word count.


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Los Gatos Tennis Academy | Academy Registration</title>


<script language="JavaScript" type="text/javascript">

<!--
function validate()
{
var elems = document.forms['form1'].elements;
var helpmsg = '';

if (elems['01_PlayersName'].value == "")
{helpmsg = helpmsg + 'Please enter Players Name' + '\n';}
if (elems['02_BirthDate'].value == "")
{helpmsg = helpmsg + 'Please enter Birthdate' + '\n';}
if (elems['03_ParentsName'].value == "")
{helpmsg = helpmsg + 'Please enter Parents Name' + '\n';}
if (elems['04_PhoneNumber1'].value == "")
{helpmsg = helpmsg + 'Please enter Phone Number' + '\n';}
if (elems['05_ParentsName'].value == "")
{helpmsg = helpmsg + 'Please enter Parents Name' + '\n';}
if (elems['06_Address1'].value == "")
{helpmsg = helpmsg + 'Please enter Address' + '\n';}
if (elems['07_PhoneNumber'].value == "")
{helpmsg = helpmsg + 'Please enter alternate Phone Number' + '\n';}
if (elems['08_Address2'].value == "")
{helpmsg = helpmsg + 'Please enter second Address' + '\n';}
if (elems['email'].value == "")
{helpmsg = helpmsg + 'Please enter Email' + '\n';}
if (elems['10_SchoolAttending'].value == "")
{helpmsg = helpmsg + 'Please enter School Attending' + '\n';}
if (elems['11_TournamentExperience'].value == "")
{helpmsg = helpmsg + 'Please enter Tournament Experience' + '\n';}
if (elems['160_IndemnityAgreement'].checked)
{}
else
{helpmsg = helpmsg + 'IndemnityAgreement' + '\n';}



if (helpmsg !== '')
{
alert(helpmsg)
return false;
}
else
{return true;}
}

function calculate()
{
var elems = document.forms['form1'].elements;
var total = 0;
if (elems['12_AcademyDayPass'].checked) { total += 60.00; }
if (elems['13_Academy10-pack'].checked) { total += 500.00; }
if (elems['14_HighSchoolDiscount'].checked) { total = total - (total * 0.15); }
if (elems['15_SiblingDiscount'].checked) { total = total - (total * 0.50); }
elems['16_total'].value = total;
}

function hidiscount()
{
document.forms['form1'].elements['15_SiblingDiscount'].checked = false;
calculate();
}

function sibdiscount()
{
document.forms['form1'].elements['14_HighSchoolDiscount'].checked = false;
calculate();
}


//-->

</script>

</head>

<body>

<form name="form1" method="post" actio=""/>

<table width="757" border="1" cellpadding="5" cellspacing="1" bordercolor="#333333">
<tr>
<td colspan="4"><span class="style47">Wednesdays - Fridays 5:00-7:00 p.m. @ Los Gatos High School<br />
Saturdays 12:00-4:00 p.m. @ Los Gatos High School</span></td>
</tr>
<tr>
<td width="4%"><input name="12_AcademyDayPass" onclick="calculate()" type="checkbox"></td>
<td width="34%"><span class="style47">Academy Day Pass<br />
(4 Hour Academy Practice) </span></td>
<td width="22%"><span class="style47">$60</span></td>
<td width="40%" rowspan="3"><div align="center"></div></td>
</tr>
<tr>
<td><input name="13_Academy10-pack" onclick="calculate()" type="checkbox" value="500" /></td>
<td><span class="style47">Academy 10-Pack<br />
(40 Hours of Academy Practice </span></td>
<td><span class="style47">$500</span></td>
</tr>
<tr>
<td colspan="2"><p class="style52">&nbsp;</p>
<p class="style64">DISCOUNTS</p></td>
<td>&nbsp;</td>
</tr>
<tr>
<td><input name="14_HighSchoolDiscount" onclick="hidiscount()" type="checkbox" value="0.10" /></td>
<td colspan="3"><span class="style47">Los Gatos High School Students: 15% Discount</span></td>
</tr>
<tr>
<td><input name="15_SiblingDiscount" onclick="sibdiscount()" type="checkbox" value="0.50" /></td>
<td colspan="3"><span class="style47">Sibling Discount*: 50% Discount<br />
<span class="style29">*Discount applicable only if players participate in the same LGTA program.</span></span></td>
</tr>
<tr>
<td>&nbsp;</td>
<td colspan="3">&nbsp;</td>
</tr>
<tr>
<td colspan="4"><table width="99%" border="1" align="right" cellpadding="5" cellspacing="0" bordercolor="#EAEAEA">
<tr>
<td><table width="100%" border="0" align="right" cellpadding="0">
<tr>
<td width="12%"><div align="left"><span class="style63">TOTAL DUE:</span></div></td>
<td width="88%"><input type="text" name="16_total" size="10" onclick="calculate()" /></td>
</tr>
<tr>
<td colspan="2"><div align="left"><span class="style60">*Please make checks payable to Todd Dissly Athletics.</span></div></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>

<tr>
<td><input name="160_IndemnityAgreement" type="checkbox" onclick="validate()" /></td>
<td colspan="3"><span class="style60">I have read and agree with the terms of this agreement.</span></td>
</tr>
<tr>
<td>&nbsp;</td>
<td colspan="3">&nbsp;</td>
</tr>
<tr>
<td colspan="4"><div align="center">
<input name="Submit" onclick="return validate()" type="submit" class="style63" value="Register Now" />
</div></td>
</tr>

</table></td>
</tr>
</table></td>
</tr>
</table>
</form>
</body>
</html>
Apr 30 '07 #1
1 1809
iam_clint
1,208 Expert 1GB
you wrote your validation kinda awkward.


var elems = document.forms.form1;
elems.whatever.value
Apr 30 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: NecroJoe | last post by:
I am using PHP to generate a little javascript for one of my pages. In short it allows a user to select a value from a list and pop it into a form field on a seperate page. This works well unless...
104
by: Leszek | last post by:
Hi. Is it possible in javascript to operate on an array without knowing how mamy elements it has? What i want to do is sending an array to a script, and this script should add all values from...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.