472,801 Members | 1,226 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,801 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 1783
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...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
linyimin
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: lllomh | last post by:
How does React native implement an English player?
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

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.