Quote:
Originally Posted by andynov123
I moved the <script> and its contents and I went into error console in chrome but it's blank. I wasn't sure if I looked in the right place for the console so I took a screenshot in the image below of where I was.
|
A screenshot is no use whatsoever. Use your browser error console (F12).
You persistently use Id instead of id - Javascript is case sensitive. Id is meaningless to Javascript.
You also persistently use document.getElementbyId - again, Javascript is case sensitive.
onClick should be onclick.
You also use the same id for HTML elements and Javascript variables. Very unwise.
Use Number() to convert the string values entered by the user:-
var Adult = Number(document.getElementbyId('adult').value); // Javascript is case sensitive so Adult is not the same as adult
// etc.
var total = parseFloat(adult + child + senior + military + seniorday + studentday); //
concatenates the 6 string values and converts to a real number. Use Number() to make the individual values numbers, and remove parseFloat(). In any case the number of tickets must be an integer, so parseFloat() makes no sense.
You have not specified the width and height of your image.
You have assigned the same name
quantity to multiple variables.
May be other errors as well.
My advice would be to strip your code down to just one element to start with, test that and get it working before moving on.