bad in javascript? do you have experience in other technologies? javascript is not the only way to do so.
start your function using the onclick, and use the getElement("elementId").getValue() methods to retrieve the values of your input fields.
when you've completed your mathematical operation(s), just use getElement("elementID").setValue(resultOfCalculation)
I'm not sure if it's get/setValue(), since I don't really use javascript that often, it's possible that it 's get/setText()
stultuske
Industrious Poster
4,496 posts since Jan 2007
Reputation Points: 1,377
Solved Threads: 630
Skill Endorsements: 25
There are no getElement(), get/setValue() or get/setText methods in javascript.
document.getElementById('elementId').value
Also look at using the onchange event. You could also use the output form element, however it is not supported yet by IE. http://www.w3schools.com/html5/tag_output.asp
Please try writing some code and when you get stuck, ask for help with exactly what you are stuck on.
stbuchok
Practically a Posting Shark
883 posts since May 2011
Reputation Points: 138
Solved Threads: 124
Skill Endorsements: 2
as I said, I don't use javascript very often, I just knew it's something similar to that :)
stultuske
Industrious Poster
4,496 posts since Jan 2007
Reputation Points: 1,377
Solved Threads: 630
Skill Endorsements: 25