Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
script in ASP , but I want results [and start html page] appear in a small, popup win
Old 12-07-2007, 05:10 PM script in ASP , but I want results [and start html page] appear in a small, popup win
Experienced Talker

Posts: 34
Trades: 0
I make a month loan payment calculation script in ASP , but I want results [and start html page] appear in a small, popup window 500w x 400h and no right-click permitted , how to do in javascript ?

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

html doc

Code:
<HTML>
<HEAD>
Code:
 
<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">&nbsp;</TD>
  <TD width="192">&nbsp;</TD>
 </TR>
 <TR>
  <TD>Amount to Borrow(CY&pound;):</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>&nbsp;</p>
</BODY>
</HTML>


asp doc

Code:
<% 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>
Code:
 
<% 
 ' 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&pound;):</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&pound;):<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>
lse123 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 12-07-2007, 10:11 PM Re: script in ASP , but I want results [and start html page] appear in a small, popup
ForrestCroce's Avatar
Half Man, Half Amazing

Posts: 3,023
Name: Forrest Croce
Location: Seattle, WA
Trades: 0
Collect the input through your form, then on submit, use a script to launch a new window and send the info to your results page with the query string. Or cookies.

You really can't prevent right clicking, at least with any consistency. Many browsers let users disable javascript that does this, and others have plugins that do it.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
ForrestCroce is offline
Reply With Quote
View Public Profile Visit ForrestCroce's homepage!
 
Old 12-08-2007, 02:28 AM Re: script in ASP , but I want results [and start html page] appear in a small, popup
Experienced Talker

Posts: 34
Trades: 0
I want when user clicks the link: Mortage calculator appear a window 500x400 with html file: http://www.kolectivavillas.com/papho.../loan_calc.htm

when user presses submit results appear in the same size window...

How I generally de-activate right-mouse-click in js in a doc html or asp or php ? where include this code ?
lse123 is offline
Reply With Quote
View Public Profile
 
Old 12-08-2007, 04:25 AM Re: script in ASP , but I want results [and start html page] appear in a small, popup
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,519
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
no right click script
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Reply     « Reply to script in ASP , but I want results [and start html page] appear in a small, popup win
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.86501 seconds with 12 queries