Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Totals working in IE but not Netscape 1

Status
Not open for further replies.

Dollie

MIS
May 2, 2000
765
US
We have a script that allows people to enter in numbers and the total will automatically calculate. This works in IE but not Netscape.

Any suggestions?? [sig]<p> <br><a href=mailto: > </a><br><a href= > </a><br> [/sig]
 
Dollie, Can you post your code here, i think it is a javascript or html problem

[sig]<p>Chiu Chan<br><a href=mailto:cchan@gefmus.com>cchan@gefmus.com</a><br><a href= America, Inc</a><br>[/sig]
 
Thanks for the quick response! Here's the code we're fighting with. We believe the problem is in the very last line of the code.

Thanks for any help you can provide!
---------------------------------------------------

<SCRIPT language=JavaScript>
function sumBillable() {
with(document.all)
{
if (isNaN(oSatHrs.value)) {
oSatHrs.Value = 0.00;
}
if (isNaN(oSunHrs.value)) {
oSunHrs.Value = 0.00;
}
if (isNaN(oMonHrs.value)) {
oMonHrs.Value = 0.00;
}
if (isNaN(oTueHrs.value)) {
oTueHrs.Value = 0.00;
}
if (isNaN(oWedHrs.value)) {
oWedHrs.Value = 0.00;
}
if (isNaN(oThuHrs.value)) {
oThuHrs.Value = 0.00;
}
if (isNaN(oFriHrs.value)) {
oFriHrs.Value = 0.00;
}
var satHrs = parseFloat(oSatHrs.value);
var sunHrs = parseFloat(oSunHrs.value);
var monHrs = parseFloat(oMonHrs.value);
var tueHrs = parseFloat(oTueHrs.value);
var wedHrs = parseFloat(oWedHrs.value);
var thuHrs = parseFloat(oThuHrs.value);
var friHrs = parseFloat(oFriHrs.value);

if ( satHrs < 0 || satHrs > 24) {
alert(&quot;Saturday Hours: Please Enter a value between 0 and 24&quot;);
return;
}
if (sunHrs < 0 || sunHrs > 24) {
alter(&quot;Sunday Hours: Please Enter a value between 0 and 24&quot;);
return;
}
if (monHrs < 0 || monHrs > 24) {
alter(&quot;Monday Hours: Please Enter a value between 0 and 24&quot;);
return;
}
if (tueHrs < 0 || tueHrs > 24) {
alter(&quot;Tuesday Hours: Please Enter a value between 0 and 24&quot;);
return;
}
if (tueHrs < 0 || tueHrs > 24) {
alter(&quot;Wednesday Hours: Please Enter a value between 0 and 24&quot;);
return;
}
if (sunHrs < 0 || sunHrs > 24) {
alter(&quot;Thursday Hours: Please Enter a value between 0 and 24&quot;);
return;
}
if (sunHrs < 0 || sunHrs > 24) {
alter(&quot;Friday Hours: Please Enter a value between 0 and 24&quot;);
return;
}
oSumHrs.value = satHrs + sunHrs + monHrs + tueHrs + wedHrs + thuHrs + friHrs;
}
}
</SCRIPT> [sig]<p> <br><a href=mailto: > </a><br><a href= > </a><br> [/sig]
 
Dollie,

please be aware that (document.all) ONLY works for IE,
for netscape, try &quot;document.layer&quot;
[sig]<p>Chiu Chan<br><a href=mailto:cchan@gefmus.com>cchan@gefmus.com</a><br><a href= America, Inc</a><br>[/sig]
 
Sorry, it is &quot;document.layers&quot; with the &quot;S&quot;
[sig]<p>Chiu Chan<br><a href=mailto:cchan@gefmus.com>cchan@gefmus.com</a><br><a href= America, Inc</a><br>[/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top