Results 1 to 2 of 2

Thread: Session object and onstart functionality

  1. #1

    Thread Starter
    Lively Member
    Join Date
    May 2000
    Location
    Canada
    Posts
    70
    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!

  2. #2
    Frenzied Member monte96's Avatar
    Join Date
    Sep 2000
    Location
    Somewhere in AZ
    Posts
    1,379
    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:

    Code:
    <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>
    oOOo--oOOo
    __/\/\onte96
    oOOo--oOOo
    Senior Programmer/Analyst
    MCP
    [email protected]
    [email protected]


    Your results may vary.. some restrictions may apply.. pricing and participation may vary.. not available in all states.. professional driver closed course..quantities limited..

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width