A BIG Hiya everyone,
I’d hate to have my first post to be in regards to a problem I need a bit of help with, but I’ve exhausted all of my ideas to fix the problem…which haven’t worked at all ?
I’m a beginner in Javascript and am teaching myself about it, so feel free to criticize everything and anything ?
Firstly, the code:
[CODE]function DoMath() {
var Adult = document.regform.Adult.value;
var AdultCost = document.regform.AdultCost.value;
var Child = document.regform.Child.value;
var ChildCost = document.regform.ChildCost.value;
var ParticipantTotal = Adult * AdultCost + Math.min(Child, 1)*ChildCost;
var Kids461 = document.regform.Kids461.value;
var Kids681 = document.regform.Kids681.value;
var Kids101 = document.regform.Kids101.value;
var Small1 = document.regform.Small1.value;
var Medium1 = document.regform.Medium1.value;
var Large1 = document.regform.Large1.value;
var XL1 = document.regform.XL1.value;
var XXL1 = document.regform.XXL1.value;
var XXXL1 = document.regform.XXXL1.value;
var Caps1 = document.regform.Caps1.value;
var Kids46 = document.regform.Kids46.value;
var Kids68 = document.regform.Kids68.value;
var Kids10 = document.regform.Kids101.value;
var Small = document.regform.Small.value;
var Medium = document.regform.Medium.value;
var Large = document.regform.Large.value;
var XL = document.regform.XL.value;
var XXL = document.regform.XXL.value;
var XXXL = document.regform.XXXL.value;
var Caps = document.regform.Caps.value;
var MerchTotal = (Kids461 * Kids46)+(Kids681 * Kids68)+(Kids101 * Kids10)+(Small * Small1)+(Medium * Medium1)+(Large * Large1)+(XL * XL1)+(XXL * XXL1)+(XXXL * XXXL1)+(Caps * Caps1);
document.regform.Participant.value = ParticipantTotal;
document.regform.Merchandise.value = MerchTotal;
document.regform.Total.value = ParticipantTotal+MerchTotal;
}
It’s code to calculate the total cost of merchandise people can buy, and how much it will cost for a number of people to attend a function…but the problem is, Safari won’t either recognise or run the code. All other scripts work, like the validation of the order/registration form except the calculations script…? It’s also working in IE NN FF MO OP, but just not Safari.
The following link will take you to the page to which this code applies:
[URL=”http://three.eightblack.com/fcw/form.html”]Here’s the page!
Again, it’s only a problem within Safari and all other browsers work fine.
Thanks for listening everyone, hopefully i’ve given enough specific info for it to be useful! ?
Cheers
Nick