[thelist] ASP: variable in a comparison

McCreath_David McCreath_David at xmail.asd.k12.ak.us
Thu Sep 7 23:11:02 CDT 2000


Ooooh...I hope somebody's awake...

Here's the short question:

How do I call a declared variable in this statement?

  if Request.Form("navigation")="'call variable here'" then
  Response.Redirect("step'call variable here'.asp")

I tried this:

  if Request.Form("navigation")="& VariableName &" then

and that's not working. (I have the Response.Redirect hardcoded right now.)

Longish explanation:

I'm building a little nav tool for a multipage form where each page is a
prerequisite for the next. So on the very first page, I set a key on a
session cookie called "CurrentStep" with a value of "1" and insert that into
a column on a table in the database. Then on every page following, I check
that cookie and compare it to a number on the page. (This is just to keep
people from jumping ahead.)

If "CurrentStep" is less than or equal to the number on the page, then I set
it as a variable, and set two more variables based on it: 

  NextStep=Request.Cookies("CurrentStep")+1 
  PreviousStep=Request.Cookies("CurrentStep")-1

The way this plays into the nav tool is that when I build the select for the
nav tool, I use those three variables as the values for "Save current data
and 1)Proceed, 2)Repeat [some pages can have multiple entries], 3) Go Back,
or 4) Log Out.

The pages are called "stepX.asp".

'Zat all make sense?

Dave workin' late
np:cablemusic.com -- Trance




More information about the thelist mailing list