Current location: Hot Scripts Forums » General Web Coding » JavaScript » form result page


form result page

Reply
  #1 (permalink)  
Old 12-18-03, 09:06 PM
krikri krikri is offline
New Member
 
Join Date: Dec 2003
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
form result page

Hi,
I have a form which accepts input alright but cannot display the results on another page.

The form is at krikri dot 0catch dot com


Here is the code :
----------------------------
<SCRIPT language=javascript>
<!--
function lst_onChange(lst) {
var v = lst.options[lst.selectedIndex].value;
if ((v.length > 1) && (v != "null")) {
window.location.href = v;
}
}

function MM_checkBrowser(NSvers,NSpass,NSnoPass,IEvers,IEpa ss,IEnoPass,OBpass,URL,altURL) { //v3.0
var newURL='', verStr=navigator.appVersion, app=navigator.appName, version = parseFloat(verStr);
if (app.indexOf('Netscape') != -1) {
if (version >= NSvers) {if (NSpass>0) newURL=(NSpass==1)?URL:altURL;}
else {if (NSnoPass>0) newURL=(NSnoPass==1)?URL:altURL;}
} else if (app.indexOf('Microsoft') != -1) {
if (version >= IEvers || verStr.indexOf(IEvers) != -1)
{if (IEpass>0) newURL=(IEpass==1)?URL:altURL;}
else {if (IEnoPass>0) newURL=(IEnoPass==1)?URL:altURL;}
} else if (OBpass>0) newURL=(OBpass==1)?URL:altURL;
if (newURL) { window.location=unescape(newURL); document.MM_returnValue=false; }
}

function MM_findObj(n, d) { //v3.0
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}

function MM_validateForm() { //v3.0
var i,p,q,nm,test,num,min,max,errors='',args=MM_valida teForm.arguments;
for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
if (val) { nm=val.name; if ((val=val.value)!="") {
if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
} else if (test!='R') { num = parseFloat(val);
if (val!=''+num) errors+='- '+nm+' must contain a number.\n';
if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
min=test.substring(8,p); max=test.substring(p+1);
if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
} } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
} if (errors) alert('The following error(s) occurred:\n'+errors);
document.MM_returnValue = (errors == '');
}

function commas(pre) {
pre = pre.toString();
if (pre.substring(0, 1)=="-") {
sign = "-";
pre = pre.substring(1, pre.length);
}
else
sign = "";
i = pre.length
while (i > 3) {
pre = pre.substring(0, i-3) + "," + pre.substring(i-3, pre.length);
i = i - 3;
}
pre = sign + pre;
return pre;
}
function txt1a_onChange() {
document.frmEval.txt1b.value = document.frmEval.txt1a.value*12;
}
function txt3a_onChange() {
document.frmEval.txt3b.value = Math.round((document.frmEval.txt1b.value-document.frmEval.txt3a.value)/document.frmEval.txt1b.value*100);
}
function lst5_onChange() {
if (document.frmEval.lst5.options[document.frmEval.lst5.selectedIndex].value=="No")
document.frmEval.txt6.value = "0";
else
document.frmEval.txt6.value = "";
}
function lst9a_onChange() {
document.frmEval.txt9b.value = document.frmEval.txt1b.value*document.frmEval.lst9 a.options[document.frmEval.lst9a.selectedIndex].value/100;
}
function btnCalculate_onClick(primerate) {
with (document.frmEval) {
txt1b.value = txt1a.value*12;
txt3b.value = Math.round((txt1b.value-txt3a.value)/txt1b.value*100);
txt9b.value = txt1b.value*lst9a.options[lst9a.selectedIndex].value/100;
daysAROutstanding.value = Math.round(txt2.value/txt1a.value*30);
daysOrderToPaid.value = Math.round(parseFloat(txt10.value)+parseFloat(days AROutstanding.value.replace(/,/g, "")));
percentCashFlowIncrease.value = Math.round(parseFloat(daysAROutstanding.value.repl ace(/,/g, ""))/parseFloat(daysOrderToPaid.value.replace(/,/g, ""))*100);
dollarTradeDiscountSaves.value = commas(Math.round(txt6.value/100*txt3a.value));
dollarAdditionalSales.value = commas(Math.round((parseFloat(txt1b.value)-parseFloat(txt3a.value))/txt1b.value*txt9b.value));
dollarCurrentFinanceCost.value = commas(Math.round(((txt1a.value*(1-(parseFloat(txt3b.value/100)))*(daysOrderToPaid.value.replace(/,/g, "")/365))*12)*txt8.value/100));
dollarProfitIncrease.value = commas(Math.round(parseFloat(dollarTradeDiscountSa ves.value.replace(/,/g, ""))+parseFloat(dollarAdditionalSales.value.replac e(/,/g, ""))+parseFloat(dollarCurrentFinanceCost.value.rep lace(/,/g, ""))));
dollarPotentialCost.value = commas(Math.round(parseFloat((parseFloat(txt1b.val ue/(365/parseFloat(daysAROutstanding.value.replace(/,/g, ""))))+parseFloat(txt9b.value/(365/parseFloat(daysAROutstanding.value.replace(/,/g, "")))))*(parseFloat(primerate)/100))+parseFloat(((parseFloat(txt1b.value)+parseFl oat(txt9b.value))*0.02))));
dollarNetProfits.value = commas(Math.round(parseFloat(dollarProfitIncrease. value.replace(/,/g, ""))-parseFloat(dollarPotentialCost.value.replace(/,/g, ""))));
percentProfitIncrease.value = Math.round(100*(parseFloat(dollarNetProfits.value. replace(/,/g, ""))/(txt1b.value*(txt4.value/100))));
dblPrimeRate.value = primerate;

if (parseFloat(dollarNetProfits.value)>0)
boolYesNo.value = "YES";
else
boolYesNo.value = "NO";
}
}
//-->
</SCRIPT>
<LINK href="Factoring Calculator_files/ie.css" rel=stylesheet>
<META
content="See if factoring could increase your company's cash flow by running your A/R numbers."
name=description>
<META content="Microsoft FrontPage 5.0" name=GENERATOR></HEAD>
<BODY bgColor=#ffffff leftMargin=0 topMargin=0
onload="MM_checkBrowser(4.0,0,1,4.0,0,1,1,'../home_gen.asp','');return document.MM_returnValue"
marginheight="0" marginwidth="0">
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
<TR vAlign=top bgColor=#003366>
<TD height=60>&nbsp;</TD></TR></TBODY></TABLE>
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
<TR>
<TD vAlign=top width=144 bgColor=#003366>
&nbsp;</TD>
<TD vAlign=top>
<TABLE height="100%" cellPadding=5 width="100%" border=0>
<TBODY>
<TR class=BodyText vAlign=top>
<TD class=BodyText>
<FORM name=frmEval
onsubmit="MM_validateForm('txt1a','','RisNum','txt 2','','RisNum','txt3a','','RisNum','txt4','','RisN um','txt6','','RisNum','txt8','','RisNum','txt10', '','RisNum');return document.MM_returnValue"
action=evalresult.asp method=post>
<TABLE cellPadding=2 border=0>
<TBODY>
<TR vAlign=top>
<TD colSpan=4>
<H1>Factoring Calculator</H1>
<P class=BodyText>To find out if factoring makes sense for
your business, please respond to each question; enter 0 if
there is no value. </P>
</TD></TR>
<TR vAlign=top>
<TD class=Footer width=22>1.</TD>
<TD class=Footer>What is your average monthly sales volume?
</TD>
<TD class=Footer align=right width=18>$</TD>
<TD class=Footer width=100><INPUT class=Footer
onchange=txt1a_onChange() size=8 name=txt1a> </TD></TR>
<TR vAlign=top>
<TD class=Footer width=22>&nbsp;</TD>
<TD class=Footer>This suggests your annual sales volume equals
</TD>
<TD class=Footer align=right width=18>$</TD>
<TD class=Footer width=100><INPUT class=Footer disabled size=8
name=txt1b> </TD></TR>
<TR vAlign=top>
<TD class=Footer width=22>2.</TD>
<TD class=Footer>What is your current outstanding balance of
accounts receivable? </TD>
<TD class=Footer align=right width=18>$</TD>
<TD class=Footer width=100><INPUT class=Footer size=8
name=txt2> </TD></TR>
<TR vAlign=top>
<TD class=Footer width=22>3.</TD>
<TD class=Footer>What is the dollar amount of your annual cost
of goods sold? (How much does it cost to make or provide your
product or service?) </TD>
<TD class=Footer align=right width=18>$</TD>
<TD class=Footer width=100><INPUT class=Footer
onchange=txt3a_onChange() size=8 name=txt3a> </TD></TR>
<TR vAlign=top>
<TD class=Footer width=22>&nbsp;</TD>
<TD class=Footer>Your Answer to Question #3 suggests an annual
Gross Profit Margin of: </TD>
<TD class=Footer align=right width=18>&nbsp;</TD>
<TD class=Footer width=100><INPUT class=Footer disabled size=8
name=txt3b> % </TD></TR>
<TR vAlign=top>
<TD class=Footer width=22>4.</TD>
<TD class=Footer>What is your Company's annual profit margin?
</TD>
<TD class=Footer align=right width=18>&nbsp;</TD>
<TD class=Footer width=100><INPUT class=Footer size=8
name=txt4> % </TD></TR>
<TR vAlign=top>
<TD class=Footer width=22>5.</TD>
<TD class=Footer>Do your vendors offer trade discounts if you
pay early? </TD>
<TD class=Footer align=right width=18>&nbsp;</TD>
<TD class=Footer width=100><SELECT class=Footer
onchange=lst5_onChange() name=lst5> <OPTION value=Yes
selected>Yes</OPTION> <OPTION value=No>No</OPTION></SELECT>
</TD></TR>
<TR vAlign=top>
<TD class=Footer width=22>6.</TD>
<TD class=Footer>If yes, how much do they offer in discounts?
</TD>
<TD class=Footer align=right width=18>&nbsp;</TD>
<TD class=Footer width=100><INPUT class=Footer size=8
name=txt6> % </TD></TR>
<TR vAlign=top>
<TD class=Footer width=22>7.</TD>
<TD class=Footer>How are you financing your business today?
<BR><INPUT type=checkbox value=checkbox name=chk7a>
Bank<BR><INPUT type=checkbox value=checkbox name=chk7b> Credit
Cards<BR><INPUT type=checkbox value=checkbox name=chk7c>
Family and Friends<BR><INPUT type=checkbox value=checkbox
name=chk7d> Other Loan Sources</TD>
<TD class=Footer align=right width=18>&nbsp;</TD>
<TD class=Footer width=100>&nbsp;</TD></TR>
<TR vAlign=top>
<TD class=Footer width=22>8.</TD>
<TD class=Footer>What is the average annual cost of this
financing? (percentage rate) </TD>
<TD class=Footer align=right width=18>&nbsp;</TD>
<TD class=Footer width=100><INPUT class=Footer size=8
name=txt8> % </TD></TR>
<TR vAlign=top>
<TD class=Footer width=22>9.</TD>
<TD class=Footer>How much more business could your company do
if you had money today to buy materials? </TD>
<TD class=Footer align=right width=18>&nbsp;</TD>
<TD class=Footer width=100><SELECT class=Footer
onchange=lst9a_onChange() name=lst9a> <OPTION value=0
selected>0</OPTION> <OPTION value=10>10</OPTION> <OPTION
value=20>20</OPTION> <OPTION value=30>30</OPTION> <OPTION
value=40>40</OPTION> <OPTION value=50>50</OPTION> <OPTION
value=75>75</OPTION> <OPTION value=100>100</OPTION> <OPTION
value=150>150</OPTION> <OPTION value=200>200</OPTION></SELECT>
% </TD></TR>
<TR vAlign=top>
<TD class=Footer width=22>&nbsp;</TD>
<TD class=Footer>This would translate into an incremental
dollar amount in sales of: </TD>
<TD class=Footer align=right width=18>$</TD>
<TD class=Footer width=100><INPUT class=Footer disabled size=8
name=txt9b> </TD></TR>
<TR vAlign=top>
<TD class=Footer width=22>10.</TD>
<TD class=Footer>How long does it take you to make or provide
your product or service? </TD>
<TD class=Footer align=right width=18>&nbsp;</TD>
<TD class=Footer width=100><INPUT class=Footer size=8
name=txt10> days </TD></TR></TBODY></TABLE><INPUT type=hidden
name=daysAROutstanding> <INPUT type=hidden name=daysOrderToPaid>
<INPUT type=hidden name=percentCashFlowIncrease> <INPUT type=hidden
name=dollarTradeDiscountSaves> <INPUT type=hidden
name=dollarAdditionalSales> <INPUT type=hidden
name=dollarCurrentFinanceCost> <INPUT type=hidden
name=dollarProfitIncrease> <INPUT type=hidden
name=dollarPotentialCost> <INPUT type=hidden name=dollarNetProfits>
<INPUT type=hidden name=percentProfitIncrease> <INPUT type=hidden
name=boolYesNo> <INPUT type=hidden name=dblPrimeRate>
<P align=left><INPUT class=BodyText onclick=btnCalculate_onClick(5) type=submit value=Calculate name=btnCalculate>
<INPUT class=BodyText type=reset value=Clear name=btnClear>
</P></FORM></TD>
<TD class=Footer width=170><BR>
</TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE>
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
<TR>
<TD class=Footer width=144 bgColor=#003366 rowSpan=2>&nbsp; </TD>
<TD class=Footer rowSpan=2>
<TABLE cellPadding=4 width="100%" border=0>
<TBODY>
<TR>
<TD class=Footer>&nbsp;</TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></BODY></HTML>

--------------------------------------
Please what should I do to display the results on another page.

Thank you.
Reply With Quote
  #2 (permalink)  
Old 12-18-03, 10:06 PM
Xtremist Xtremist is offline
Newbie Coder
 
Join Date: Aug 2003
Location: Pensacola, FL
Posts: 99
Thanks: 0
Thanked 0 Times in 0 Posts
Use ASP since the page is asp....

Use this:

<%
fieldname1 = request.form("fieldname1")
fieldname2 = request.form("fieldname2")
fieldname3 = request.form("fieldname3")

and so on for the fields in your form...

%>

To display them....

Hello <% = fieldname1 %>.

or if you want to stay in asp

<% response.write "Hello " & fieldname1 & "." %>

Does that make sense????

If not, check this out for assistance > http://www.w3schools.com/asp/asp_inputforms.asp
__________________
Chris
http://www.pensacolawebdesigns.com
I know it's not much but I never find time to work on my own site
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Redirection back to a page from form submit DAL Perl 11 03-21-05 02:45 PM
formmail problem gscraper Perl 12 08-27-04 03:06 AM
index page not showing up skipper23 PHP 3 12-15-03 01:10 PM
passing array to hidden fields in form on next page? seala ASP 2 09-04-03 02:40 PM
Need Bravenet Alternative... bobby444 General HotScripts Site Discussion 10 07-17-03 09:36 PM


All times are GMT -5. The time now is 11:37 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.