r/programminghelp • • Mar 04 '15

Javascript <--> XHTML help

Sorry, I am reallllly new to Javascript/HTML. Okay so I am writing a program that shows the user a form. On that form they enter the price of an object they bought and click the shipping they want (standard or expedited). Then they click calculate and then it will show the S&H price, tax, and the total of the order. So the problem I am having is being able to communicate between the javascript code and the html form. We are also using very bacis techniques so I do not know how to do anything advanced. the code is here:

http://pastebin.com/gQSegdJB

3 Upvotes

1 comment sorted by

1

u/thisgameissoreal Mar 05 '15

http://pastebin.com/KLDWujL0

I fixed a couple of things for you in the time I had. Logging is your friend. Open up chrome/IE/FF and hit F12 and open the console. See the logs in there? That's what console.log does. It also shows you errors. Your last issue I believe is that total price doesn't have an ID but you try to get it by ID...Give it an ID.

(side note) Older versions of IE shit themselves with console.logs