Site hosted by Angelfire.com: Build your free website today!

Free Codes




GoTo HomePage
Introduction
Contact US
Resume
Sample
Cytek.Com

 
VBScript
Here are some sample VBScripts, you can see the action by clicking on the corresponding buttons in the table. You are welcome to copy the code and use/modify, a link back to this page is appreciated. It is a Good Practice to include the scripts within the <head> & </head> tags.

VBScriptAction
<script LANGUAGE="VBScript">
<!--
Sub HelloButton_OnClick
    MsgBox "Hello World!"
End Sub
-->
</script>

Do not copy these two lines... Copy below this line for the code
<form> <input name="HelloButton" type="button" value="say hello"> </form>
<script language="VBScript">
<!--
sub calculate_OnClick()
Dim MonthlyPayment
Dim MPR
If mp.cost.value="" or mp.cost.value=0 then
  MsgBox "You must enter a value for the cost of the car"
  Exit Sub
End If
If mp.months.value="" or mp.months.value=0 then
  MsgBox "You must enter a value for the Number of Months"
  Exit Sub
End If
If mp.interest.value="" or mp.interest.value=0 then
  MsgBox "You must enter a value for the Interest Rate"
  Exit Sub
End If
MPR=(1+(mp.interest.value/100))^(1/12)
MonthlyPayment=((mp.cost.value)/(mp.months.value))*MPR
MonthlyPayment=MonthlyPayment*100
MonthlyPayment=MonthlyPayment\1
MonthlyPayment=MonthlyPayment/100
mp.payment.value=MonthlyPayment
End Sub
-->
</script>

-- do not copy these two lines.. -- copy down from here for the form
<center> <b>Mortgage/Monthly<br> Payment Calculator</b></center> <hr> <form name="mp"> <b>Cost:</b> <br> <input name="cost"><br> <b>No. of Months:</b><br> <input name="months"><br> <b>Interest Rate:</b><br> <input name="interest"><br> <br> <center> <input type="button" Name="calculate" value="Calculate"> <input type="reset" value="reset"> </form> </center> <b>Monthly Payment is<br> $</b><input name="payment">
Mortgage/Monthly
Payment Calculator

Must fill all the 3 fields
Cost:

No. of Months:

Interest Rate:


Monthly Payment is
$

Home |  Intro |  Contact |  Samples |  Resume