0% found this document useful (0 votes)
13 views

Javascript - Deposit Verification Page

The document contains code for a calculator web page that allows a user to enter a deposit amount and select an account type, then calculates the total amount including a percentage fee that varies by account. The code uses JavaScript functions to retrieve the input values, determine the selected account type, calculate the result by adding the fee amount to the deposit, and display the total in an output field.
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views

Javascript - Deposit Verification Page

The document contains code for a calculator web page that allows a user to enter a deposit amount and select an account type, then calculates the total amount including a percentage fee that varies by account. The code uses JavaScript functions to retrieve the input values, determine the selected account type, calculate the result by adding the fee amount to the deposit, and display the total in an output field.
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

alpha nauts, working na ung javascript... may finals na tayo sa Computer =_= i.

edit nyo
nlng.

-------------------------------------------------------------------------------------------------------------

<html>
<head>
<title>Calculator</title>

Deposit verification page

<script type="text/javascript">
function frenzie()
{
var num1Object=document.getElementById("num1");
var num2Object=document.getElementById("num2");
var result=0;
var selectedItem = document.rivera.accounts.value;

if(selectedItem == "master")
{
result=parseInt((num1Object.value)*(0.10)) + parseInt(num1Object.value);
}

else if(selectedItem == "visa")


{
result = parseInt((num1Object.value)*(0.15)) + parseInt(num1Object.value);
}

else if(selectedItem == "savings")


{
result= parseInt((num1Object.value)*(0.20)) + parseInt(num1Object.value);
}

else if(selectedItem == "current")


{
result=parseInt((num1Object.value)*(0.05)) + parseInt(num1Object.value);

{
(num2Object.value = result);
}

</script>
</head>
<body>
<div id="content">
<form action="#" name="rivera" method="post">
<table>
<tr>
<td><input type="text" maxlength="10" size="15" id="num1" name="num1"/>

<select name="accounts">
<option value="" selected>---select account type---</option>
<option value="current">current</option>
<option value="master">master</option>
<option value="visa">visa</option>
<option value="savings">savings</option>
</select>

RESULT 
<input type="text" maxlength="10" size="15" id="num2" name="num2"/>
</tr>
<tr>
<td colspan="3"><input type="button" name="calculate" value="COMPUTE" onclick="frenzie();"/>
<input type="reset" name="clear" value="CLEAR"/></td>
</tr>
</table>
</form>
</div>
</body>
</html>

You might also like