Fundamental ASP question

I'm trying to understand the basics of VBscript in regards to initializing and incrementing variables. This all started while I was trying write a "multi-page" data entry form. Unfortunately, I never could increment the counter successfully.

The following code is a simplified version of this attempt (Note the hitcounter never exceeds 1):

<%
option explicit
dim hitcount
hitcount=0
if CStr(Request.Form("Submit")) <> "" then
hitcount = hitcount + 1
end if
%>



">





Is the hitcount variable re-initializing after each time the "Hit" button is clicked? I tried an alternate version of this where "option explicit; dim hitcount, hitcount=0" were removed, but it didn't make any difference. So what gives?
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories