using ASP / FrontPage to perform calculations - ?

M

montiy

Hello...I have NO experience writing code, so need some step-by-step help
with this issue, if someone is willing to help me.

I have used FrontPage to connect a database to a web form, into which users
will enter data like Games Played, Points, Rebounds, Assists, etc. -- Then I
want to create a Database Results Region that can calcultate and display data
like Points Per Game (points divided by games played), Rebounds Per Game
(rebounds divided by games played), etc.

I know very little about writing code, so I could use some help knowing
exactly WHERE to put each bit of code. I have only used FrontPage to build
my site, and know how to use just the basics. I could use some step-by-step
help from someone who is willing. Thanks!

-- Nate
 
D

David Berry

You asked this same question last week and were given a lot of code samples.
Did they not work for you?
 
M

montiy

Yes, you did reply last week -- but because I am such a beginner (having very
little experience writing code), I'm not sure how to apply the examples.
WHERE do I put each bit of code, and are there certain things that I need to
replace into the example code statements? I just need some more
direction...Thanks!

-- Nate
 
T

Trevor L.

montiy said:
Yes, you did reply last week -- but because I am such a beginner
(having very little experience writing code), I'm not sure how to
apply the examples. WHERE do I put each bit of code, and are there
certain things that I need to replace into the example code
statements? I just need some more direction...Thanks!

Hi Nate,

I saw the post before and thought someone would answer, but since you are
having trouble, I'll look at it a little while (this arvo, Australian time)
 
T

Trevor L.

Trevor said:
Hi Nate,

I saw the post before and thought someone would answer, but since you
are having trouble, I'll look at it a little while (this arvo,
Australian time) --

As promised.

This is the entire code that you need.

If you want other calculations, model them on those here.

E.G. for Assists per Game
Add to the function:
result3.value = +assists.value / played.value
Add to the table:
<tr>
<td>Assists Per Game: </td>
<td><input type="text" id="result3" size="20" /></td>
</tr>

<html>
<head>
<!-- THE SPECIFICATION
Enter data:
Games Played
Points
Rebounds
Assists

Calculate:
Points Per Game (points divided by games played)
Rebounds Per Game (rebounds divided by games played)
-->
<script type="text/javascript">
function calcform()
{
with (document.form1)
{
result1.value = +points.value / played.value
result2.value = +rebounds.value / played.value
}
}
</script>
</head>
<body>

<form name="form1" action="">
<table>
<tr>
<td>Games Played: </td>
<td><input type="text" id="played" value=""/></td>
</tr>
<tr>
<td>Points: </td>
<td><input type="text" id="points" value="" /></td>
</tr>
<tr>
<td>Rebounds: </td>
<td><input type="text" id="rebounds" value="" /></td>
</tr>
<tr>
<td>Assists: </td>
<td><input type="text" id="assists" value="" /></td>
</tr>
<tr>
<td>Points Per Game: </td>
<td><input type="text" id="result1" size="20" /></td>
</tr>
<tr>
<td>Rebounds Per Game: </td>
<td><input type="text" id="result2" size="20" /></td>
</tr>
</table>
<input type="button" value="Calculate" onclick="calcform()" />
</form>

</body>
</html>
 
D

David Berry

Hi Trevor. Nice code but he was trying to do this with ASP since he wants to
insert the data into a database and then retrieve and display it later.
This code would work fine for just doing client-side calculations with
JavaScript.

Montiy, it's hard to write all the code you need without knowing all the
database field names, table names etc as well as how you want to layout the
page that displays the information. The ASP code I posted shows you how to
do a basic insert into the table, pull the information back out and display
it. The best thing you can do is to take a look at the many ASP tutorial
sites out there, such as www.asp101.com, www.takempis.com, www.learnasp.com,
or www.4guysfromrolla.com and learn how ASP code works. Then, to use it you
would switch to code view and paste the code into the page.




Trevor L. said:
Trevor said:
Hi Nate,

I saw the post before and thought someone would answer, but since you
are having trouble, I'll look at it a little while (this arvo,
Australian time) --

As promised.

This is the entire code that you need.

If you want other calculations, model them on those here.

E.G. for Assists per Game Add to the function:
result3.value = +assists.value / played.value
Add to the table:
<tr>
<td>Assists Per Game: </td>
<td><input type="text" id="result3" size="20" /></td>
</tr>

<html>
<head>
<!-- THE SPECIFICATION
Enter data:
Games Played
Points
Rebounds
Assists

Calculate:
Points Per Game (points divided by games played)
Rebounds Per Game (rebounds divided by games played)
-->
<script type="text/javascript">
function calcform()
{
with (document.form1)
{
result1.value = +points.value / played.value
result2.value = +rebounds.value / played.value
}
}
</script>
</head>
<body>

<form name="form1" action="">
<table>
<tr>
<td>Games Played: </td>
<td><input type="text" id="played" value=""/></td>
</tr>
<tr>
<td>Points: </td>
<td><input type="text" id="points" value="" /></td>
</tr>
<tr>
<td>Rebounds: </td>
<td><input type="text" id="rebounds" value="" /></td>
</tr>
<tr>
<td>Assists: </td>
<td><input type="text" id="assists" value="" /></td>
</tr>
<tr>
<td>Points Per Game: </td>
<td><input type="text" id="result1" size="20" /></td>
</tr>
<tr>
<td>Rebounds Per Game: </td>
<td><input type="text" id="result2" size="20" /></td>
</tr>
</table>
<input type="button" value="Calculate" onclick="calcform()" />
</form>

</body>
</html>
--
Cheers,
Trevor L.
[ Microsoft MVP - FrontPage ]
MVPS Website: http://trevorl.mvps.org/
 
M

montiy

Thanks for the suggestions of sites. I'll spend some time in the coming days
researching those sites, and then I'll come back here for more help, when I'm
ready for it (after playing with my site, based on the research I do). I
suppose that I could easily give you the database field names, table names,
sample code, etc. -- and that might simplify things...Am I right? I'm using
the Database Results Wizard to display the results...I'm mainly confused
about a) WHERE exactly I need to write the different pieces of code...and b)
WHAT PARTS of the code I need to "replace" with something different (the name
of a table, etc).

--
Nate



David Berry said:
Hi Trevor. Nice code but he was trying to do this with ASP since he wants to
insert the data into a database and then retrieve and display it later.
This code would work fine for just doing client-side calculations with
JavaScript.

Montiy, it's hard to write all the code you need without knowing all the
database field names, table names etc as well as how you want to layout the
page that displays the information. The ASP code I posted shows you how to
do a basic insert into the table, pull the information back out and display
it. The best thing you can do is to take a look at the many ASP tutorial
sites out there, such as www.asp101.com, www.takempis.com, www.learnasp.com,
or www.4guysfromrolla.com and learn how ASP code works. Then, to use it you
would switch to code view and paste the code into the page.




Trevor L. said:
Trevor said:
montiy wrote:
Yes, you did reply last week -- but because I am such a beginner
(having very little experience writing code), I'm not sure how to
apply the examples. WHERE do I put each bit of code, and are there
certain things that I need to replace into the example code
statements? I just need some more direction...Thanks!

--
Nate

Hi Nate,

I saw the post before and thought someone would answer, but since you
are having trouble, I'll look at it a little while (this arvo,
Australian time) --

As promised.

This is the entire code that you need.

If you want other calculations, model them on those here.

E.G. for Assists per Game Add to the function:
result3.value = +assists.value / played.value
Add to the table:
<tr>
<td>Assists Per Game: </td>
<td><input type="text" id="result3" size="20" /></td>
</tr>

<html>
<head>
<!-- THE SPECIFICATION
Enter data:
Games Played
Points
Rebounds
Assists

Calculate:
Points Per Game (points divided by games played)
Rebounds Per Game (rebounds divided by games played)
-->
<script type="text/javascript">
function calcform()
{
with (document.form1)
{
result1.value = +points.value / played.value
result2.value = +rebounds.value / played.value
}
}
</script>
</head>
<body>

<form name="form1" action="">
<table>
<tr>
<td>Games Played: </td>
<td><input type="text" id="played" value=""/></td>
</tr>
<tr>
<td>Points: </td>
<td><input type="text" id="points" value="" /></td>
</tr>
<tr>
<td>Rebounds: </td>
<td><input type="text" id="rebounds" value="" /></td>
</tr>
<tr>
<td>Assists: </td>
<td><input type="text" id="assists" value="" /></td>
</tr>
<tr>
<td>Points Per Game: </td>
<td><input type="text" id="result1" size="20" /></td>
</tr>
<tr>
<td>Rebounds Per Game: </td>
<td><input type="text" id="result2" size="20" /></td>
</tr>
</table>
<input type="button" value="Calculate" onclick="calcform()" />
</form>

</body>
</html>
--
Cheers,
Trevor L.
[ Microsoft MVP - FrontPage ]
MVPS Website: http://trevorl.mvps.org/
 
D

David Berry

Nate,

The code I gave you was pure ASP code, not DRW code. I don't know how you'd
alter the DRW code (I don't use it). The easiest thing to do is start with
a new page and try the ASP code to see how it works and then build on the
page from there. Here's an example that you can use to get started.

STEP 1 - create the page with the form. (Ex: Form.asp)

----------

<html>

<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 1</title>
</head>

<body>

<form method="POST" name="PointsPerGame" action="Insert.asp">
<p>Games:
<!--webbot bot="Validation" S-Display-Name="You must enter a number"
S-Data-Type="Number" S-Number-Separators=",." B-Value-Required="TRUE"
I-Minimum-Length="1" S-Validation-Constraint="Greater than or equal to"
S-Validation-Value="0" -->
<input type="text" name="Games" size="20"></p>
<p>Points: <input type="text" name="Points" size="20"></p>
<p>Rebounds: <input type="text" name="Rebounds" size="20"></p>
<p>Assists:&nbsp; <input type="text" name="Assists" size="20"></p>
<p><input type="submit" value="Submit" name="B1"><input type="reset"
value="Reset" name="B2"></p>
</form>

</body>

</html>

-----------

Notice that the form"Action" posts to another ASP page (I called it
Insert.asp). This is the page that will collect the information from the
form, do the calculations, insert into the database and then display the
results from the user. I also added validation on the first field (Games)
to make it required and that they enter a number. You might want this on
all fields.

STEP 2 - Create the ASP Page

Switch to code view and paste all this code in

--------

<!--METADATA
type="typelib" uuid="00000205-0000-0010-8000-00AA006D2EA4" name="ADODB Type
Library"
-->

<%@ Language=VBScript %>
<%

' first connect to the database and set up your recordset

strConnection = DSN="Insert Your DSN Name Here;"
Set adoCN = server.CreateObject("ADODB.connection")
Set adoRS = server.CreateObject("ADODB.recordset")
adoCN.Open strConnection
adoRS.ActiveConnection = adoCN
adoRS.CursorLocation = 3

%>

<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 1</title>
</head>
<%
' get the data from the form

intGames = Request.Form("Games")
intPoints = Request.Form("Points")
intRebounds = Request.Form("Rebounds")
intAssists = Request.Form("Assists")

' now do your math

intPointsPerGame = intPoints / intGames

'now insert the values into the database

strSQL = "INSERT INTO TableName
(Games,Points,Rebounds,Pickup,Assists,PointsPerGame) "
strSQL = strSQL & "VALUES( " & _
intGames & ", " & _
intPoints & ", " & _
intRebounds & ", " & _
intAssists & ", " & _
intPointsPerGame & "' )"
adoCN.Execute strSQL

%>
<body>

Points Per Game = <%=intPointsPerGame%>

</body>

</html>

--------

You will need to add the name of your DSN Connection to the database, the
name of the table and the correct names of the fields to get this to work.

This should give you a starting point.

Dave


montiy said:
Thanks for the suggestions of sites. I'll spend some time in the coming
days
researching those sites, and then I'll come back here for more help, when
I'm
ready for it (after playing with my site, based on the research I do). I
suppose that I could easily give you the database field names, table
names,
sample code, etc. -- and that might simplify things...Am I right? I'm
using
the Database Results Wizard to display the results...I'm mainly confused
about a) WHERE exactly I need to write the different pieces of code...and
b)
WHAT PARTS of the code I need to "replace" with something different (the
name
of a table, etc).

--
Nate



David Berry said:
Hi Trevor. Nice code but he was trying to do this with ASP since he wants
to
insert the data into a database and then retrieve and display it later.
This code would work fine for just doing client-side calculations with
JavaScript.

Montiy, it's hard to write all the code you need without knowing all the
database field names, table names etc as well as how you want to layout
the
page that displays the information. The ASP code I posted shows you how
to
do a basic insert into the table, pull the information back out and
display
it. The best thing you can do is to take a look at the many ASP tutorial
sites out there, such as www.asp101.com, www.takempis.com,
www.learnasp.com,
or www.4guysfromrolla.com and learn how ASP code works. Then, to use it
you
would switch to code view and paste the code into the page.




Trevor L. said:
Trevor L. wrote:
montiy wrote:
Yes, you did reply last week -- but because I am such a beginner
(having very little experience writing code), I'm not sure how to
apply the examples. WHERE do I put each bit of code, and are there
certain things that I need to replace into the example code
statements? I just need some more direction...Thanks!

--
Nate

Hi Nate,

I saw the post before and thought someone would answer, but since you
are having trouble, I'll look at it a little while (this arvo,
Australian time) --

As promised.

This is the entire code that you need.

If you want other calculations, model them on those here.

E.G. for Assists per Game Add to the function:
result3.value = +assists.value / played.value
Add to the table:
<tr>
<td>Assists Per Game: </td>
<td><input type="text" id="result3" size="20" /></td>
</tr>

<html>
<head>
<!-- THE SPECIFICATION
Enter data:
Games Played
Points
Rebounds
Assists

Calculate:
Points Per Game (points divided by games played)
Rebounds Per Game (rebounds divided by games played)
-->
<script type="text/javascript">
function calcform()
{
with (document.form1)
{
result1.value = +points.value / played.value
result2.value = +rebounds.value / played.value
}
}
</script>
</head>
<body>

<form name="form1" action="">
<table>
<tr>
<td>Games Played: </td>
<td><input type="text" id="played" value=""/></td>
</tr>
<tr>
<td>Points: </td>
<td><input type="text" id="points" value="" /></td>
</tr>
<tr>
<td>Rebounds: </td>
<td><input type="text" id="rebounds" value="" /></td>
</tr>
<tr>
<td>Assists: </td>
<td><input type="text" id="assists" value="" /></td>
</tr>
<tr>
<td>Points Per Game: </td>
<td><input type="text" id="result1" size="20" /></td>
</tr>
<tr>
<td>Rebounds Per Game: </td>
<td><input type="text" id="result2" size="20" /></td>
</tr>
</table>
<input type="button" value="Calculate" onclick="calcform()" />
</form>

</body>
</html>
--
Cheers,
Trevor L.
[ Microsoft MVP - FrontPage ]
MVPS Website: http://trevorl.mvps.org/
 
M

montiy

OK...I've spent some time researching, but have not found a simple
answer...so I'm going to copy my code here and see if someone can help me.

This code is for a page on which a user is entering soccer stats (games
played, goals scored, shots at goal, assists, goals allowed, saves, and
shutouts). Then I'd like to calculate goal percentage (= goals / shots at
goal) and save percentage (= saves / (saves + goals allowed). I'd like all
of these results (those entered AND calculated) to be placed into a database
table.

I do not yet have the "Goal Percentage" and "Save Percentage" fields created
in the database. I can do that easily, but I figured I'd ask for help here
before I took the next steps.

Currently my form connects to the database, and all of the entered fields
will be saved into the database fields. I just need to know how to get the
form to perform and store the calculations. Can you help?

Code is below...(If there's an easier or better way for me to provide the
code, let me know...Thanks!)

-- Nate

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

<%
' FP_ASP ASP Automatically generated by a FrontPage Component. Do not Edit.

On Error Resume Next
Session("FP_OldCodePage") = Session.CodePage
Session("FP_OldLCID") = Session.LCID
Session.CodePage = 1252
Session.LCID = 1033
Err.Clear

strErrorUrl = "stat_submission_form_soccer_boys.asp"

If Request.ServerVariables("REQUEST_METHOD") = "POST" Then
If Request.Form("VTI-GROUP") = "0" Then
Err.Clear

Set fp_conn = Server.CreateObject("ADODB.Connection")
FP_DumpError strErrorUrl, "Cannot create connection"

Set fp_rs = Server.CreateObject("ADODB.Recordset")
FP_DumpError strErrorUrl, "Cannot create record set"

fp_conn.Open Application("stat_submission_form_soccer_boys_ConnectionString")
FP_DumpError strErrorUrl, "Cannot open database"

fp_rs.Open "Results", fp_conn, 1, 3, 2 ' adOpenKeySet, adLockOptimistic,
adCmdTable
FP_DumpError strErrorUrl, "Cannot open record set"

fp_rs.AddNew
FP_DumpError strErrorUrl, "Cannot add new record set to the database"
Dim arFormFields0(12)
Dim arFormDBFields0(12)
Dim arFormValues0(12)

arFormFields0(0) = "Games_Played"
arFormDBFields0(0) = "Games_Played"
arFormValues0(0) = Request("Games_Played")
arFormFields0(1) = "First_Name"
arFormDBFields0(1) = "First_Name"
arFormValues0(1) = Request("First_Name")
arFormFields0(2) = "School"
arFormDBFields0(2) = "School"
arFormValues0(2) = Request("School")
arFormFields0(3) = "Shots_At_Goal"
arFormDBFields0(3) = "Shots_At_Goal"
arFormValues0(3) = Request("Shots_At_Goal")
arFormFields0(4) = "Assists"
arFormDBFields0(4) = "Assists"
arFormValues0(4) = Request("Assists")
arFormFields0(5) = "Shutouts"
arFormDBFields0(5) = "Shutouts"
arFormValues0(5) = Request("Shutouts")
arFormFields0(6) = "Grade"
arFormDBFields0(6) = "Grade"
arFormValues0(6) = Request("Grade")
arFormFields0(7) = "Last_Name"
arFormDBFields0(7) = "Last_Name"
arFormValues0(7) = Request("Last_Name")
arFormFields0(8) = "Goals_Scored"
arFormDBFields0(8) = "Goals_Scored"
arFormValues0(8) = Request("Goals_Scored")
arFormFields0(9) = "HS_Enrollment"
arFormDBFields0(9) = "HS_Enrollment"
arFormValues0(9) = Request("HS_Enrollment")
arFormFields0(10) = "Goals_Allowed"
arFormDBFields0(10) = "Goals_Allowed"
arFormValues0(10) = Request("Goals_Allowed")
arFormFields0(11) = "Saves"
arFormDBFields0(11) = "Saves"
arFormValues0(11) = Request("Saves")

FP_SaveFormFields fp_rs, arFormFields0, arFormDBFields0

If Request.ServerVariables("REMOTE_HOST") <> "" Then
FP_SaveFieldToDB fp_rs, Request.ServerVariables("REMOTE_HOST"),
"Remote_computer_name"
End If
If Request.ServerVariables("HTTP_USER_AGENT") <> "" Then
FP_SaveFieldToDB fp_rs, Request.ServerVariables("HTTP_USER_AGENT"),
"Browser_type"
End If
FP_SaveFieldToDB fp_rs, Now, "Timestamp"
If Request.ServerVariables("REMOTE_USER") <> "" Then
FP_SaveFieldToDB fp_rs, Request.ServerVariables("REMOTE_USER"), "User_name"
End If

fp_rs.Update
FP_DumpError strErrorUrl, "Cannot update the database"

fp_rs.Close
fp_conn.Close

Session("FP_SavedFields")=arFormFields0
Session("FP_SavedValues")=arFormValues0
Session.CodePage = Session("FP_OldCodePage")
Session.LCID = Session("FP_OldLCID")
Response.Redirect "stat_submission_form_soccer_boys.asp"

End If
End If

Session.CodePage = Session("FP_OldCodePage")
Session.LCID = Session("FP_OldLCID")

%>
<html>

<head>
<meta http-equiv="Content-Language" content="en-us">
<meta name="GENERATOR" content="Microsoft FrontPage 6.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>NCSAA - Stat Submission Form - Boys' Soccer</title>
<meta name="Microsoft Theme" content="ncsaa-expedition 0011, default">
</head>

<body>
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse:
collapse; border-style: solid; border-width: 0" width="100%">
<tr>
<td width="100%" align="center" style="border-style: solid;
border-width: 0; padding-left: 4; padding-right: 4; padding-top: 1;
padding-bottom: 1">
<p align="center" style="margin-top: 0; margin-bottom: 0">
<img border="1" src="NCSAA_Logo_New.jpg" width="143" height="83">
<map name="FPMap2">
<area href="ncsaa_home.htm" shape="rect" coords="4, 0, 47, 59">
<area href="mission.htm" shape="rect" coords="51, 0, 104, 59">
<area href="schools.htm" shape="rect" coords="110, 1, 162, 59">
<area href="publications.htm" shape="rect" coords="233, 0, 309, 59">
<area href="events.htm" shape="rect" coords="313, 0, 361, 59">
<area href="news.htm" shape="rect" coords="366, 0, 408, 59">
<area href="support.htm" shape="rect" coords="412, 0, 467, 59">
<area href="advertising.htm" shape="rect" coords="471, 0, 545, 59">
<area href="information.htm" shape="rect" coords="551, 0, 626, 59">
<area href="contact.htm" shape="rect" coords="631, 0, 687, 59">
<area href="services.htm" shape="rect" coords="162, 5, 228, 52">
</map>
<img border="0" src="Home%20Page%20Menu%20Banner%20SERVICES%20copy.gif"
usemap="#FPMap2" width="688" height="60"></td>
</tr>
</table>

<p align="center" style="margin-top: 0; margin-bottom: 0">
</p>

<div align="center">
<center>
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse:
collapse; border-style: solid; border-width: 0; padding-left: 4;
padding-right: 4; padding-top: 1; padding-bottom: 1" width="97%"
bgcolor="#0000CC" height="30">
<tr>
<td width="14%" align="center" style="border:1px solid #000000; "
height="28">
<p style="margin-top: 0; margin-bottom: 0"><font color="#FFFFFF"><b>
<a style="color: #FFFFFF; font-weight: bold; text-decoration: none"
href="coaches_services.htm">
Coaches'</a></b></font><p style="margin-top: 0; margin-bottom:
0"><font color="#FFFFFF"><b>
<a style="color: #FFFFFF; font-weight: bold; text-decoration: none"
href="coaches_services.htm">
Services</a></b></font></td>
<td width="14%" align="center" height="30" style="border:1px solid
#000000; " bordercolorlight="#000000" bordercolordark="#000000">
<p style="margin-top: 0; margin-bottom: 0"><font color="#FFFFFF"><b>
<a href="equipment_program.htm" style="text-decoration: none">
<font color="#FFFFFF">Equipment</font></a></b></font><p
style="margin-top: 0; margin-bottom: 0"><font color="#FFFFFF"><b>
<a href="equipment_program.htm" style="text-decoration: none">
<font color="#FFFFFF">Program</font></a></b></font></td>
<td width="14%" align="center" height="30" style="border: 1px solid
#000000">
<p style="margin-top: 0; margin-bottom: 0"><font color="#FFFFFF"><b>
<a href="community_programs.htm" style="text-decoration: none">
<font color="#FFFFFF">Community</font></a></b></font><p
style="margin-top: 0; margin-bottom: 0"><font color="#FFFFFF"><b>
<a href="community_programs.htm" style="text-decoration: none">
<font color="#FFFFFF">Programs</font></a></b></font></td>
<td width="14%" align="center" height="30" style="border: 1px solid
#000000"><font color="#FFFFFF"><b>
<a style="text-decoration: none" href="speakers_bureau.asp">
<font color="#FFFFFF">Speakers' Bureau</font></a></b></font></td>
<td width="15%" align="center" height="30" style="border: 1px solid
#000000">
<font color="#FFFFFF"><b>
<a href="awards.htm" style="text-decoration: none"><font
color="#FFFFFF">
Awards</font></a></b></font></td>
<td width="15%" align="center" height="30" style="border: 1px solid
#000000; ">
<font color="#FFFFFF"><b>
<a href="recruiting_service.htm" style="text-decoration: none">
<font color="#FFFFFF">Recruiting Service</font></a></b></font></td>
<td width="15%" align="center" height="30" style="border: 4px solid
#000000; ">
<p style="margin-top: 0; margin-bottom: 0"><font color="#FFFFFF"><b>
<a href="stat_ranking_service.htm" style="text-decoration: none">
<font color="#FFFFFF">Stat Ranking</font></a></b></font></p>
<p style="margin-top: 0; margin-bottom: 0"><font color="#FFFFFF"><b>
<a href="stat_ranking_service.htm" style="text-decoration: none">
<font color="#FFFFFF">Service</font></a></b></font></td>
</tr>
</table></center>
</div>

<p align="center" style="margin-top: 0; margin-bottom: 0">
</p>
<table border="10" cellpadding="5" cellspacing="0" style="border-collapse:
collapse" width="100%" id="table4">
<tr>
<td width="100%" bordercolorlight="#FF0000" bordercolordark="#024EFD"
style="border-right-color: #800000; border-bottom-color: #800000">
<p align="center" style="margin-top: 0; margin-bottom: 0"><font
face="Berlin Sans FB" size="6" color="#024EFD">
NCSAA Stat Submission Form - BOYS' SOCCER</font></p>
<p align="center" style="margin-top: 0; margin-bottom: 0">(<b>Please
submit only
high school varsity team statistics. Also, do not submit stats for an
indoor soccer season.</b>)</p>
<p align="center" style="margin-top: 0; margin-bottom: 0"> </p>
<p align="right" style="margin-top: 0; margin-bottom: 0">
<font size="2">
<a href="stat_submission_forms.htm">Back to Stat Submission Forms for All
Sports</a></font></p>
<p align="left" style="margin-top: 0; margin-bottom: 0"><b>Instructions
for
submitting stats:</b></p>
<p align="left" style="margin-top: 0; margin-bottom: 0"> </p>
<p align="justify" style="margin-top: 0; margin-bottom: 0"><b>1)
</b>Please
submit stats ONLY for players on your <i><b>high school varsity</b></i>
boys' soccer team.</p>
<p align="justify" style="margin-top: 0; margin-bottom: 0"><b>2)
</b>Please
complete the following form completely to submit stats for one player.
Press "Submit" after you are finished completing the form.</p>
<p align="justify" style="margin-top: 0; margin-bottom: 0"><b>3)
</b>After
submitting.the form, you will be returned to this form to submit stats for
another player. Repeat for as many players as you wish..</p>
<p align="justify" style="margin-top: 0; margin-bottom: 0"><b>4) </b>We
will compile the stats and
update the <a href="stat_leaders_board.htm">Stat Leaders Board</a>.
Thanks for participating!</p>
<p align="justify" style="margin-top: 0; margin-bottom: 0"><b>5) </b>Any
errors or problems can be reported to 724-846-2764 or
<a href="mailto:[email protected]">[email protected]</a>. Feel free
to call with questions, problems, or suggestions.</p>
<p align="center" style="margin-top: 0; margin-bottom: 0"> </p>
<form method="POST" name="FrontPage_Form1" action="--WEBBOT-SELF--"
onSubmit="" language="JavaScript">
<!--webbot bot="SaveDatabase" s-builtin-fields="REMOTE_HOST
HTTP_USER_AGENT Timestamp REMOTE_USER" s-form-fields="Games_Played First_Name
School Shots_At_Goal Assists Shutouts Grade Last_Name Goals_Scored
HS_Enrollment Goals_Allowed Saves"
u-confirmation-url="stat_submission_form_soccer_boys.asp" startspan
SuggestedExt="asp" S-DataConnection="stat_submission_form_soccer_boys"
S-RecordSource="Results"
U-Database-URL="fpdb/stat_submission_form_soccer_boys.mdb"
U-Validation-Error-Url="stat_submission_form_soccer_boys.asp"
S-Builtin-DBFields="Remote_computer_name Browser_type Timestamp User_name"
S-Form-DBFields="Games_Played First_Name School Shots_At_Goal Assists
Shutouts Grade Last_Name Goals_Scored HS_Enrollment Goals_Allowed Saves"
U-ASP-Include-Url="_fpclass/fpdbform.inc" --><input TYPE="hidden"
NAME="VTI-GROUP" VALUE="0"><!--#include
file="_fpclass/fpdbform.inc"--><!--webbot bot="SaveDatabase" endspan
i-checksum="40548" --><p align="left" style="margin-top: 0; margin-bottom: 0">
Name of School:
<!--webbot bot="Validation" b-value-required="TRUE"
b-disallow-first-item="TRUE" -->
<select size="1" name="School" tabindex="1">
<option>Select school.</option>
<option>Beaver County Christian (Beaver Falls, PA)</option>
<option>Betesda Christian (Opa-Locka, FL)</option>
<option>Blackhawk Christian (Fort Wayne, IN)</option>
<option>Briarcrest Christian (Memphis, TN)</option>
<option>Calvary Baptist (Hurricane, WV)</option>
<option>Cambridge Christian (Cambridge, MN)</option>
<option>Cape Christian (Cape May Court House, NJ)</option>
<option>Cascade Christian (Jacksonville, OR)</option>
<option>Champion Christian (Chico, CA)</option>
<option>Charlotte Christian (Charlotte, NC)</option>
<option>Cheswick Christian (Cheswick, PA)</option>
<option>Clinton Christian (Upper Marlboro, MD)</option>
<option>Colorado Springs Christian (Colorado Springs, CO)</option>
<option>Coral Springs Christian (Coral Springs, FL)</option>
<option>Covenant Christian (Dandridge, TN)</option>
<option>Covenant Christian (Indianapolis, IN)</option>
<option>Eden Christian (Sewickley, PA)</option>
<option>Erie First Christian (Erie, PA)</option>
<option>Evangel Heights Christian (Sarver, PA)</option>
<option>Faith Heritage School (Syracuse, NY)</option>
<option>First Baptist Academy (Dallas, TX)</option>
<option>Grace Brethren Christian (Clinton, MD)</option>
<option>Great Commission Schools (Altoona, PA)</option>
<option>Heartland Christian (Columbiana, OH)</option>
<option>High Point Christian (High Point, NC)</option>
<option>Juniata Mennonite (McAlisterville, PA)</option>
<option>King's High School (Shoreline, WA)</option>
<option>Lexington Christian (Lexington, KY)</option>
<option>Liberty Christian (Columbus, OH)</option>
<option>Linfield Christian (Temecula, CA)</option>
<option>Lynden Christian (Lynden, WA)</option>
<option>Merritt Island Christian (Merritt Island, FL)</option>
<option>Mifflin County Christian (McClure, PA)</option>
<option>Morningside Academy (Port St. Lucie, FL)</option>
<option>Norfolk Christian (Norfolk, VA)</option>
<option>Northeast Christian (Kingwood, TX)</option>
<option>Northumberland Christian (Northumberland, PA)</option>
<option>Oaks Christian (Westlake Village, CA)</option>
<option>Oakwood Christian (Troy, NY)</option>
<option>Oklahoma Christian Academy (Edmond, OK)</option>
<option>Oklahoma Christian School (Edmond, OK)</option>
<option>Our Savior New American (Centereach, NY)</option>
<option>Pella Christian (Pella, IA)</option>
<option>Peoria Christian (Peoria, IL)</option>
<option>Phil-Mont Christian (Erdenheim, PA)</option>
<option>Portersville Christian (Portersvile, PA)</option>
<option>Riverdale Baptist (Upper Marlboro, MD)</option>
<option>Robinson Township Christian (McKees Rocks, PA)</option>
<option>San Jacinto Christian (Amarillo, TX)</option>
<option>Shenandoah Valley Christian (Stephens City, VA)</option>
<option>Sioux Falls Christian (Sioux Falls, SD)</option>
<option>South Shore Christian (Weymouth, MA)</option>
<option>The Master's Academy (Oviedo, FL)</option>
<option>Trinity Christian (Montville, NJ)</option>
<option>Trinity Christian (Pittsburgh, PA)</option>
<option>Turlock Christian (Turlock, CA)</option>
<option>Upland Christian (Upland, CA)</option>
<option>Vacaville Christian (Vacaville, CA)</option>
<option>Veritas Christian (Fletcher, NC)</option>
<option>Veritas Christian (Lawrence, KS)</option>
<option>Wesleyan School (Norcross, GA)</option>
<option>Westminster Academy (Fort Lauderdale, FL)</option>
<option>Westminster Christian (Opelousas, LA)</option>
<option>Wheaton Academy (West Chicago, IL)</option>
<option>Wilmington Christian (Hockessin, DE)</option>
<option>Wilson Christian (West Mifflin, PA)</option>
<option>Xenia Christian (Xenia, OH)</option>
<option>Zion Christian (Columbia, TN)</option>
</select></p>
<p align="left" style="margin-top: 0; margin-bottom: 0"> </p>
<p align="left" style="margin-top: 0; margin-bottom: 0">Total Number of
Students in High School (Grades 9-12):
<!--webbot bot="Validation" s-data-type="Integer" s-number-separators="x"
b-value-required="TRUE" i-minimum-length="1" i-maximum-length="4" -->
<input type="text" name="HS_Enrollment" size="8" tabindex="2"
maxlength="4"></p>
<p align="left" style="margin-top: 0; margin-bottom: 0"> </p>
<table border="1" style="border-collapse: collapse" width="93%" id="table5">
<tr>
<td width="13%"><font size="2">Player's Last Name:</font></td>
<td width="22%" colspan="2"> <!--webbot bot="Validation"
s-data-type="String" b-value-required="TRUE" i-minimum-length="2"
i-maximum-length="30" --><input type="text" name="Last_Name" size="32"
tabindex="3" maxlength="30"></td>
<td width="13%"><font size="2">Player's First Name:</font></td>
<td width="13%" colspan="2"> <!--webbot bot="Validation"
s-data-type="String" b-value-required="TRUE" i-minimum-length="2"
i-maximum-length="30" --><input type="text" name="First_Name" size="32"
tabindex="4" maxlength="30"></td>
<td width="13%"><font size="2">Year in School:</font></td>
<td width="11%"> <!--webbot bot="Validation" b-value-required="TRUE"
b-disallow-first-item="TRUE" --><select size="1" name="Grade" tabindex="5">
<option>Select a grade.</option>
<option>Senior</option>
<option>Junior</option>
<option>Sophomore</option>
<option>Freshman</option>
<option>Grade 8</option>
<option>Grade 7</option>
</select></td>
</tr>
<tr>
<td width="13%" colspan="8"> </td>
</tr>
<tr>
<td width="13%"><font size="2">Games Played:</font></td>
<td width="11%"> <!--webbot bot="Validation" s-data-type="Integer"
s-number-separators="x" b-value-required="TRUE" i-minimum-length="1"
i-maximum-length="2" --><input type="text" name="Games_Played" size="11"
tabindex="6" maxlength="2"></td>
<td width="13%"> </td>
<td width="13%"> </td>
<td width="13%"> </td>
<td width="11%"> </td>
<td width="13%"> </td>
<td width="11%"> </td>
</tr>
<tr>
<td width="13%"><font size="2">Shots at Goal:</font></td>
<td width="11%"> <!--webbot bot="Validation" s-data-type="Integer"
s-number-separators="x" i-maximum-length="3" --><input type="text"
name="Shots_At_Goal" size="11" tabindex="7" maxlength="3"></td>
<td width="13%"><font size="2">Goals Scored:</font></td>
<td width="13%"> <!--webbot bot="Validation" s-data-type="Integer"
s-number-separators="x" i-maximum-length="3" --><input type="text"
name="Goals_Scored" size="11" tabindex="8" maxlength="3"></td>
<td width="13%"><font size="2">Assists:</font></td>
<td width="11%"> <!--webbot bot="Validation" s-data-type="Integer"
s-number-separators="x" i-maximum-length="3" --><input type="text"
name="Assists" size="11" tabindex="9" maxlength="3"></td>
<td width="13%"> </td>
<td width="11%"> </td>
</tr>
<tr>
<td width="13%" colspan="8"> </td>
</tr>
<tr>
<td width="13%" height="32"><u><b><i>Goaltenders</i></b></u><i><u><b>
Only</b></u><b>:</b></i></td>
<td width="11%" height="32"> </td>
<td width="13%" height="32"> </td>
<td width="13%" height="32"> </td>
<td width="13%" height="32"> </td>
<td width="11%" height="32"> </td>
<td width="13%" height="32"> </td>
<td width="11%" height="32"> </td>
</tr>
<tr>
<td width="13%"><font size="2">Goals Allowed:</font></td>
<td width="11%"> <!--webbot bot="Validation" s-data-type="Integer"
s-number-separators="x" i-maximum-length="3" --><input type="text"
name="Goals_Allowed" size="11" tabindex="10" maxlength="3"></td>
<td width="13%"><font size="2">Saves:</font></td>
<td width="13%"> <!--webbot bot="Validation" s-data-type="Integer"
s-number-separators="x" b-value-required="TRUE" i-maximum-length="3"
--><input type="text" name="Saves" size="11" tabindex="11" maxlength="3"></td>
<td width="13%"><font size="2">Shutouts:</font></td>
<td width="11%"> <!--webbot bot="Validation" s-data-type="Integer"
s-number-separators="x" i-maximum-length="2" --><input type="text"
name="Shutouts" size="11" tabindex="12" maxlength="2"></td>
<td width="13%"> </td>
<td width="11%"> </td>
</tr>
</table>
<p align="left" style="margin-top: 0; margin-bottom: 0"> </p>
<p align="center" style="margin-top: 0; margin-bottom: 0">
<input type="submit" value="Submit" name="B3" tabindex="13"><input
type="reset" value="Reset" name="B4" tabindex="14"></p>
</form>
</td>
</tr>
</table>
<p align="center">
©<font face="Times New Roman"> Copyright 2006 NCSAA. All rights
reserved.</font></p>

</body>

</html>
 
M

montiy

OK, so I've found a relatively simple way to do the calculations -- but not
before the data is entered into the database. I've now done it WITHIN THE
DATABASE RESULTS WIZARD AREA. I just inserted a calculation code into an
empty cell in a table. This is my code (dividing one field by another):

<%=(FP_FieldVal(fp_rs,"Goals_Scored")/FP_FieldVal(fp_rs,"Shots_At_Goal"))*100%>

NOW I need some additional help (and hopefully this is simple). I need to
know how to modify my code in order to display the calculation as a PERCENT,
rounded to two decimal places. Can someone help with this?


-- Nate
 
T

Trevor L.

montiy said:
OK, so I've found a relatively simple way to do the calculations --
but not before the data is entered into the database. I've now done
it WITHIN THE DATABASE RESULTS WIZARD AREA. I just inserted a
calculation code into an empty cell in a table. This is my code
(dividing one field by another):

<%=(FP_FieldVal(fp_rs,"Goals_Scored")/FP_FieldVal(fp_rs,"Shots_At_Goal"))*100%>

NOW I need some additional help (and hopefully this is simple). I
need to know how to modify my code in order to display the
calculation as a PERCENT, rounded to two decimal places. Can someone
help with this?


-- Nate
Hi NAte,

I sent some code to do the calculations before the data was entered, but
another poster said you wanted ASP, so I desisted from further posting,
easpcailly asI don't know much ASP

Is your code not working ? It certainly looks like a percentage calculation.
I would try:
<%= FP_FieldVal(fp_rs,"Goals_Scored") /
FP_FieldVal(fp_rs,"Shots_At_Goal") * 100 %>
Or

<%= FP_FieldVal(fp_rs,"Goals_Scored") * 100 /
FP_FieldVal(fp_rs,"Shots_At_Goal") %>

To display the % sign, I would try
<%= FP_FieldVal(fp_rs,"Goals_Scored") * 100 /
FP_FieldVal(fp_rs,"Shots_At_Goal") & "%" %>

But to round it, try
<%= FormatNumber( FP_FieldVal(fp_rs,"Goals_Scored") * 100 /
FP_FieldVal(fp_rs,"Shots_At_Goal") , 2) & "%" %>

I have not tested any of this
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top