navigation
a webmaster learning community
     Home    Register     Search      Help      Login    
FrontPage Alternative
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Free FrontPage Templates

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

 

month loan payment calculation - results in the same window

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> ASP and Database >> month loan payment calculation - results in the same window
Page: [1]
 
lsfphelpls

 

Posts: 465
Joined: 3/16/2005
Status: offline

 
month loan payment calculation - results in the same wi... - 12/7/2007 15:49:29   
I make a month loan payment calculation script in ASP , but I want results appear below the form not in a new window screen , what to do ? How I include a file in asp ? I must have only one file ?

tell me for results get deleted and reappear new or results appear between form and last results for subsequent submissions ...?

form can be found at : http://www.kolectivavillas.com/paphos-land/calc/loan_calc.htm

html doc

<HTML>
<HEAD>

<TITLE>Monthly Payment</TITLE>
</HEAD>

<BODY>
<H1 align="center">Monthly Loan Payment Calculation</H1>
<P ALIGN=center>This application calculates monthly payment options for <br>
  a loan
based on the amount borrowed and an interest rate.<table width="400" align="center">
  <tr><td width="434"><FORM ACTION="MonthlyPayments.asp" METHOD=POST>
<TABLE WIDTH=94% ALIGN=center BORDER=1 CELLSPACING=1 CELLPADDING=1>
	<TR>
		<TD width="199"> </TD>
		<TD width="192"> </TD>
	</TR>
	<TR>
		<TD>Amount to Borrow(CY£):</TD>
		<TD><input type="text" name=txtLoanLow size=15></TD>
	</TR>
	<TR>
		<TD>Annual Interest Rate(%):</TD>
		<TD><INPUT TYPE="text" NAME=txtRateLow SIZE=10>
		</TD>
	</TR>
	<TR>
		<TD>Number of Years:</TD>
		<TD><INPUT TYPE="text" NAME=txtYears SIZE=10></TD></TR>
	<TR>
		<TD COLSPAN=2 ALIGN=center>
			<INPUT TYPE="submit" VALUE="Submit">
			<INPUT TYPE="reset" VALUE="Reset"> 
		</TD></TR>
</TABLE>
</FORM></td></tr></table>

<p> </p>
</BODY>
</HTML>


asp doc
<%	option explicit
	dim dblLoanLow, dblRateLow, dblYears
	dim dblRateLow1
	dim dblPayment, dblMonthlyRate, dblMonths
	dim intErrCnt
	
	intErrCnt = 0	%>
<HTML>
<HEAD>
<TITLE>MonthlyPayments.asp</TITLE>
<style type="text/css">
<!--
.style2 {
	font-family: Arial, Helvetica, sans-serif;
	font-weight: bold;
}
.style3 {
	color: #FF0000;
	font-family: Arial, Helvetica, sans-serif;
	font-size: 16px;
	font-style: normal;
	font-weight: bold;
}
-->
</style>
</HEAD>

<%	
	'	validate lower limit of loan amount
	if(not(isNumeric(Request.Form("txtLoanLow")))) then
		Response.Write "The  amount borrowed must be numeric.<BR>"
		intErrCnt = intErrCnt + 1 %>
		<input name="button" type="button" onclick="history.go(-1)" value="Back"><%
	else
		dblLoanLow = CDbl(Request.Form("txtLoanLow"))
		if(dblLoanLow < 0) then
			Response.Write "The loan amount must be a positive number.<BR>"
			intErrCnt = intErrCnt + 1%>
		<input name="button" type="button" onclick="history.go(-1)" value="Back"><%
		end if
	end if

	'	now validate the interest rates	
	if(not(isNumeric(Request.Form("txtRateLow")))) then
		Response.Write "The interest rate must be numeric.<BR>"
		intErrCnt = intErrCnt + 1%>
		<input name="button" type="button" onclick="history.go(-1)" value="Back"><%
	else
		dblRateLow = CDbl(Request.Form("txtRateLow"))
		if(dblRateLow < 1 OR dblRateLow > 100) then
		'	make sure it was entered as a percentage, not a decimal number
			Response.Write "The interest rate should be entered as a percentage, without the % sign.<BR>"
			intErrCnt = intErrCnt + 1%>
		<input name="button" type="button" onclick="history.go(-1)" value="Back"><%
		end if
	end if
	'	now convert the rate to a decimal number
	dblRateLow1 = dblRateLow / 100.0

	if(not(isNumeric(Request.Form("txtYears")))) then
		Response.Write "The number of years must be numeric not negative.<BR>"
		intErrCnt = intErrCnt + 1%>
		<input name="button" type="button" onclick="history.go(-1)" value="Back"><%
	else
		dblYears = CDbl(Request.Form("txtYears"))
	'	now convert it to the number of monthly periods
		dblMonths = dblYears * 12.0
	end if
	
	if(intErrCnt > 0) then
		Response.Write "<BR>Please press the BACK button fix any errors and re-submit."
		Response.End
	end if
	
%>
	
<BODY>
<table width="400" align="center">
  <tr><td>
<H1 align="center">Monthly Payment</H1>
<span class="style2">Amount to Borrow(CY£):</span> <span class="style3"><%= dblLoanLow %><br>
</span><span class="style2"> Length of loan: </span><span class="style3"><%= dblYears %> years<br>
</span><span class="style2"> Annual Interest Rate(%): </span><span class="style3"><%= dblRateLow %><br>
</span><span class="style2"><br>
<% 
dblMonthlyRate = dblRateLow1 / 12.0
dblMonths = dblYears * 12
dblPayment = dblLoanLow /((1 - 1 / (1 + dblMonthlyRate)^dblMonths)/dblMonthlyRate) %>

<br>
Monthly Payment(CY£):<span class="style3"> <%= FormatNumber(dblPayment,2,0,0,-2) %>
</span></span>
<P>
</td></tr>
</table>

<p align="center"><font face="Arial">
  <input name="button" type="button" onclick="history.go(-1)" value="Back">
</font></p>
</BODY>
</HTML>

Page:   [1]

All Forums >> Web Development >> ASP and Database >> month loan payment calculation - results in the same window
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts