1,105,363 Community Members

help

Member Avatar
riadh13
Newbie Poster
3 posts since Feb 2012
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

please i need to do a table in a form in wich a customer input his values and operations are calculated automatically (see picture), i am bad in javascript, can anyone help me.

[IMG]http://img11.hostingpics.net/pics/920763plan.jpg[/IMG]
http://img11.hostingpics.net/pics/920763plan.jpg
the customer input the 5 first values: monthly income, number for the 1st year, the second year the third year and the 4th year.
the total of each column must be calculated automatically, and the amount of the yearly income must be calculated automatically for each year (monthly income x number of the 1st year, monthly income x number in second year,...)

please help me
and thanks in advance

Member Avatar
stultuske
Posting Expert
5,291 posts since Jan 2007
Reputation Points: 935 [?]
Q&As Helped to Solve: 774 [?]
Skill Endorsements: 35 [?]
Featured
 
0
 

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()

Member Avatar
stbuchok
Posting Shark
957 posts since May 2011
Reputation Points: 123 [?]
Q&As Helped to Solve: 142 [?]
Skill Endorsements: 2 [?]
 
0
 

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.

Member Avatar
stultuske
Posting Expert
5,291 posts since Jan 2007
Reputation Points: 935 [?]
Q&As Helped to Solve: 774 [?]
Skill Endorsements: 35 [?]
Featured
 
0
 

as I said, I don't use javascript very often, I just knew it's something similar to that :)

Member Avatar
riadh13
Newbie Poster
3 posts since Feb 2012
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

i can't find how
who has an example please

Member Avatar
riadh13
Newbie Poster
3 posts since Feb 2012
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

up up

You
This article has been dead for over three months: Start a new discussion instead
Post:
Start New Discussion
View similar articles that have also been tagged: