/    Sign up×
Community /Pin to ProfileBookmark

JS Not working on FF

hello,

i have a javascript that calculate the total price on [url]www.madeinwater.co.uk/pool.html[/url] that is not working on FF but OK on IE.

the FF error console says “caddie is not defined” and the code is:

<script language=”javascript” type=”text/javascript”>
<!–
function calculette ()
{
var total=0;
if (caddie.include.checked)
total+=100.95;
if (caddie.X1include.checked)
total+=100.95;
if (caddie.X2include.checked)
total+=21.00;
if (caddie.X3include.checked)
total+=21.00;
if (caddie.X4include.checked)
total+=21.00;
if (caddie.X5include.checked)
total+=60.95;
if (caddie.X6include.checked)
total+=9.95;
if (caddie.X7include.checked)
total+=10.00;
if (caddie.X8include.checked)
total+=2.35;
if (caddie.X9include.checked)
total+=2.35;
if (caddie.X10include.checked)
total+=28.75;
if (caddie.X11include.checked)
total+=24.95;
if (caddie.X12include.checked)
total+=24.95;
if (caddie.X13include.checked)
total+=16.60;
if (caddie.X14include.checked)
total+=7.95;
if (caddie.X15include.checked)
total+=5.50;
if (caddie.X16include.checked)
total+=6.50;
if (caddie.X17include.checked)
total+=2.50;
if (caddie.X18include.checked)
total+=9.95;
if (caddie.X19include.checked)
total+=15.00;
caddie.Total.value=” “+total;
}
//–>
</script>

</HEAD>

how do i define caddie?
many thanks in advance for your help on this.

to post a comment
JavaScript

4 Comments(s)

Copy linkTweet thisAlerts:
@Orc_ScorcherMar 01.2008 — Insert the following line after 'var total = 0':
var caddie = document.forms.caddie
Copy linkTweet thisAlerts:
@PoudaauthorMar 01.2008 — great! that is ok now.

many thanks and have a lovely W.E
Copy linkTweet thisAlerts:
@PoudaauthorMar 01.2008 — oh! 1 more thing - any way to get only 2 decimal after the comma in the total price?

some items added give an endless number after the comma.
Copy linkTweet thisAlerts:
@Orc_ScorcherMar 01.2008 — oh! 1 more thing - any way to get only 2 decimal after the comma in the total price?[/QUOTE]
caddie.Total.value=(" "+total).toFixed(2)
×

Success!

Help @Pouda spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...