Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
30
rated 0 times [  33] [ 3]  / answers: 1 / hits: 15577  / 12 Years ago, tue, december 18, 2012, 12:00:00
<html>
<head>
<script>
function calculate(){
var a = parseFloat(frmMain.name.value);
var b = parseFloat(frmMain.Salary.value);
var c = parseFloat(frmMain.taxrate.value);
}
</script>
</head>
<body>
<form name=frmMain>
Name <input type =text id=name /><br />
Salary <input type =text id=Salary /><br />
tax rate <input type =text id=taxrate /><br />
<input type=button value=calculate onclick=calculate() />
<input type=reset value=Clear /><br />
Sammary<textarea cols=20 rows=5 ></textarea>
</form>
</body>
</html>


i try to make it like this but i dont know how to get the salary and the name and taxrate put it in the comment or notes place may any body help ?
the program should get the name and taxrate and salary and print it inside the textarea using javascript when i click on calculate ? i dont have an idea how to do this


More From » html

 Answers
8

You can use something like this



DEMO



function calculate(){   
var a = frmMain.name.value;
var b = parseFloat(frmMain.Salary.value);
var c = parseFloat(frmMain.taxrate.value);

frmMain.summary.value = Name :+a+nSalary :+b+nTax Rate :+c;
}​

[#81366] Sunday, December 16, 2012, 12 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
serena

Total Points: 488
Total Questions: 125
Total Answers: 114

Location: Estonia
Member since Wed, Jun 8, 2022
2 Years ago
;