Jag klarar inte av att göra om mitt vbScript till ASP. Kan någon vänlig själ hjälp mig? det funkar inte att bara sätta ut <% Du måste hämta in värden som TheForm.txtHomeMatches.Value först när sidan submittats. Lägg allting inom en form och låt sidan submitta till sig själv.Göra om vbScript till ASP.
<script language="VBScript">
Option Explicit
Sub cmdUpdate_OnClick
Dim TheForm
Dim dblHomeGoalsProduced, dblHomeGoalsAgainst
Dim dblAwayGoalsProduced, dblAwayGoalsAgainst
Dim dblVectorHomeGoalsProduced(9), dblVectorHomeGoalsAgainst(9), dblVectorHomeGoalsAverage(9)
Dim dblVectorAwayGoalsProduced(9), dblVectorAwayGoalsAgainst(9), dblVectorAwayGoalsAverage(9)
Dim dblHomeWinPercent, dblAwayWinPercent, dblTiePercent
Dim dblHomePercent, dblAwayPercent
Dim intFactorial, i, j
set TheForm = document.test
If IsNumeric(TheForm.txtHomeMatches.Value) = -1 and IsNumeric(TheForm.txtHomeGoalsProduced.Value) = -1 and IsNumeric(TheForm.txtHomeGoalsAgainst.Value) = -1 and IsNumeric(TheForm.txtAwayMatches.Value) = -1 and IsNumeric(TheForm.txtAwayGoalsProduced.Value) = -1 and IsNumeric(TheForm.txtAwayGoalsAgainst.Value) = -1 Then
If TheForm.txtHomeMatches.Value >= 3 and TheForm.txtHomeGoalsProduced.Value >= 0 and (TheForm.txtHomeGoalsProduced.Value / TheForm.txtHomeMatches.Value) <= 5 and TheForm.txtHomeGoalsAgainst.Value >= 0 and (TheForm.txtHomeGoalsAgainst.Value / TheForm.txtHomeMatches.Value) <= 5 and TheForm.txtAwayMatches.Value >= 3 and (TheForm.txtAwayGoalsProduced.Value / TheForm.txtAwayMatches.Value) <= 5 and TheForm.txtAwayGoalsProduced.Value >= 0 and (TheForm.txtAwayGoalsAgainst.Value / TheForm.txtAwayMatches.Value) <= 5 and TheForm.txtAwayGoalsAgainst.Value >= 0 Then
dblHomeGoalsProduced = TheForm.txtHomeGoalsProduced.Value / TheForm.txtHomeMatches.Value
dblHomeGoalsAgainst = TheForm.txtHomeGoalsAgainst.Value / TheForm.txtHomeMatches.Value
osv.......
TACK!Sv: Göra om vbScript till ASP.
vad är det som måste ändras?Sv: Göra om vbScript till ASP.
Sen kan du fånga alla värden genom att exempelvis skriva:
txtHomeMatches = Request.form("txtHomeMatches")