jonthequik
Programmer
I've got an ASP.NET 2.0 Page written in VBScript. In the script, I ask the user to enter a number of weeks and based on that number, I print a form element for each week. There is one box that the user is allowed to modify in the new form. To create the dynamic form, I do a loop and post to a Span.InnerHTML the html code for the form and add i to the end of the ID tag. I know you can access by Elements in Javascript and am trying to figure out how to do so in VBScript
...
For i=1 to intWeeks
aRank = Int((aRating/5000)+2)
aNext = (aRank-1)*5000
aDiff = (aNext-aRating)
aEarned = "13000"
aDecay1 = aRating/5
aDecay = Format$(aDecay1, "0")
aNeed = aDiff+aDecay
aNew = (aEarned-aDecay)+aRating
strHolder2 = strHolder2 & "<tr><td><Span id=spanRank" & i & " >" & aRank & "</Span></td><td><Span id=spanRating" & i & " >" & aRating & "</td><td><Span id=spanDecay" & i & " >" & aDecay & "</td><td><Span id=spanNext" & i & " >" & aNext & "</td><td><Span id=spanDiff" & i & " >" & aDiff & "</td><td><Span id=spanNeed" & i & " >" & aNeed & "</td><td><input type=text runat=server id=txtEarned" & i & " size=5 AutoPostBack=True OnTextChange=Get_Forecast value=" & aEarned & "></td><td><Span id=spanNew" & i & " >" & aNew & "</td></tr>"
aRating = aNew
Next
Once this script is posted, if they change the value in txtEarned1, txtEarned2, etc, it will postback to another subroutine to refigure the data printed.
P.S. Excuse the sloppy code, I'm about 2 weeks into VBScript/ASP
Jonathan Hannan
Computer Repair, Webdesign
HTML, CGI, PERL, JavaScript, XML
...
For i=1 to intWeeks
aRank = Int((aRating/5000)+2)
aNext = (aRank-1)*5000
aDiff = (aNext-aRating)
aEarned = "13000"
aDecay1 = aRating/5
aDecay = Format$(aDecay1, "0")
aNeed = aDiff+aDecay
aNew = (aEarned-aDecay)+aRating
strHolder2 = strHolder2 & "<tr><td><Span id=spanRank" & i & " >" & aRank & "</Span></td><td><Span id=spanRating" & i & " >" & aRating & "</td><td><Span id=spanDecay" & i & " >" & aDecay & "</td><td><Span id=spanNext" & i & " >" & aNext & "</td><td><Span id=spanDiff" & i & " >" & aDiff & "</td><td><Span id=spanNeed" & i & " >" & aNeed & "</td><td><input type=text runat=server id=txtEarned" & i & " size=5 AutoPostBack=True OnTextChange=Get_Forecast value=" & aEarned & "></td><td><Span id=spanNew" & i & " >" & aNew & "</td></tr>"
aRating = aNew
Next
Once this script is posted, if they change the value in txtEarned1, txtEarned2, etc, it will postback to another subroutine to refigure the data printed.
P.S. Excuse the sloppy code, I'm about 2 weeks into VBScript/ASP
Jonathan Hannan
Computer Repair, Webdesign
HTML, CGI, PERL, JavaScript, XML