View Single Post
Old 01-17-2013, 07:52 AM   PM User | #4
Philip M
Supreme Master coder!

 
Philip M's Avatar
 
Join Date: Jun 2002
Location: London, England
Posts: 17,033
Thanks: 197
Thanked 2,410 Times in 2,388 Posts
Philip M has a spectacular aura aboutPhilip M has a spectacular aura aboutPhilip M has a spectacular aura about
I see a lot of errors.

<script type = amountTotal(0)>
Var Total
Total = #0

Plus HTML and Javascript mixed up together haphazardly.


document.write() is in effect obsolete. document.write() statements must be run before the page finishes loading. Any document.write() statement that runs after the page finishes loading will create a new page and overwrite all of the content of the current page (including the Javascript which called it). So document.write() is at best really only useful to write the original content of your page. It cannot be used to update the content of your page after that page has loaded.

You certainly say that you suck at Java. You seem to have problems with Javascript as well. Java and Javascript are entirely different programming languages, in spite of the confusingly similar names. Rather like Austria and Australia!

BTW, when posting here please help us to help you by following the posting guidelines and wrapping your code in CODE tags. This means use the octothorpe or # button on the toolbar. You can (and should) edit your previous post.
__________________

All the code given in this post has been tested and is intended to address the question asked.
Unless stated otherwise it is not just a demonstration.

Last edited by Philip M; 01-17-2013 at 07:55 AM..
Philip M is offline   Reply With Quote