PDA

Click to See Complete Forum and Search --> : Session object and onstart functionality


rlb_wpg
Oct 19th, 2000, 09:45 AM
I have a number of html pages with the same information.
For example, start date, end date, country code etc.

What I would like to do is keep 10 values in memory.
At the start of each page I would like to check if
the variables have valid values and if they do then
set those values on the form.
When leaving the page I would like to gather the values
from that page and put them into memory.

1) Should I use the Session object?
2) How, preferably with an HTML file, do I set the values
on the form when opening the file?
3) How do I copy the form values to the object when
leaving the page?

4) While I'm at it, how do I set a default value for
<INPUT TYPE="radio" ... ?

Thanks in advance!

monte96
Oct 19th, 2000, 10:49 AM
First, you can put your initial session variables in Global.asa.

Then, you will need to pass a querystring to the next page that each page in your app will need to look for that passes your values. There is no way for the client side data to get written to server side memory without submitting a form or passing a querystring.

The only problem is that if they make changes and close the browser or navigate to a new site, the last page of data is lost.

As for radio buttons, let's say you have a set of 3 mutually exclusive radio buttons:


<INPUT TYPE=radio name=MyRadio<%If session("ValueForRadio") = 0 Then Response.Write " Checked"%>>Radio Value 1<BR>
<INPUT TYPE=radio name=MyRadio<%If session("ValueForRadio") = 1 Then Response.Write " Checked"%>>Radio Value 2<BR>
<INPUT TYPE=radio name=MyRadio<%If session("ValueForRadio") = 2 Then Response.Write " Checked"%>>Radio Value 3<BR>