Here is my code so far:
Expand|Select|Wrap|Line Numbers
- <script language="javascript" type="text/javascript">
- function houseInsurance( ){
- var basePay = (a*0.0015)+(b*0.012)
- var x = (basePay*1.15)
- var y = (basePay*1.05)
- var totalPremiums = (x+y)*1.10
- var result = c*totalPremiums
- return result;
- }
- function calculate( ) {
- var a = parseInt (document.form.housevalue.value)
- var b = parseInt (document.form.contentsvalue.value)
- var c = parseInt (document.form.noclaimbonus.value)
- document.form.total.value = result
- }
- </script>
- <body>
- <form name = "houseInsurance"><h1>House Inurance:</h1>
- House Value<br>
- <input type = "Text" value = "Enter Amount" name = "1">
- <br>
- Contents Value<br>
- <input type = "Text" value = "Enter Amount" name = "2">
- <br>
- No Claim Bonus<br>
- <input type = "Text" value = "Enter Amount" name = "3">
- <br>
- <input type = "button" value = "result" Name = "click"
- onClick = "calculate()">
- <br>
- Total<br>
- <input type = "Text" value = "Total" name = "4">
- </body>
Cheers