By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,290 Members | 1,384 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,290 IT Pros & Developers. It's quick & easy.

dynamic form - session varr get reset WHY?

P: 1

I'm getting creazy with this problem and I hope somebody can give me the reason why it's going wrong or even better, the solution.

I'm having a form what is generated dynamic.The names of the formfields are groups with the same number so the stick together and I can make collections by deviding them with there comma's.

Wat I want to do is to set a session var in the dropdowns, or other formfields to make it more easy for the user to fill in more than one time (day).

I did a trick to set the sessionName equal to the dynamic name of the field otherwise they would not combine. that go's ok.

Now where the problem starts.. if i'm not posting the form but go the the next day or just refresh the page the session varrs are empty (!?) Here is the part of code...I hope it's clear enough to get the picture..

<% if flagSubs = "1" then %>

<!-- begin table for extra taken -->
<table width="100%" border="0" cellpadding="0">

if MultitaskCount => "1" then
multitasks = "on"
dim zzz
For zzz = 1 To MultitaskCount

' response.write multitasks

<td><select name="naam<%=radioCount%>">

Do While Not SubAfdeling_rs.EOF OR SubAfdeling_rs.BOF %>
<option value="<%= trim(SubAfdeling_rs.Fields ("sub_afd")) %>"><%= SubAfdeling_rs.Fields ("sub_afd") %></option>
<% SubAfdeling_rs.MoveNext()
loop %>
<option value="<% If Request.ServerVariables("REQUEST_METHOD") = "POST" Then

if request.form("naam" & radioCount & "").Item((zzz * 2) + 2) <> "" then

aaa = """"& request.form("naam" & radioCount & "").Item((zzz * 2) + 2) & """"

session(aaa) = request.form("naam" & radioCount & "").Item((zzz * 2) + 2)

end if
end if
response.write session(aaa) %> " selected><%= session(aaa) %></option>
<td class="summery">
<select name="naam<%=radioCount%>" class="multi">
<option value="Aanwezig">Aanwezig</option>
<option value="Back-up">Back-up</option>
<option value="<% If Request.ServerVariables("REQUEST_METHOD") = "POST" Then
response.write request.form("naam" & radioCount & "").Item((zzz * 2) + 3)
end if %>" selected><% If Request.ServerVariables("REQUEST_METHOD") = "POST" Then
response.write request.form("naam" & radioCount & "").Item((zzz * 2) + 3)
end if %></option>


<% Next 'zz
end if %>


So my question is why session(aaa) exist and has a value on a post..but when i want to collect his with a refresh of the page or somewhere treu the app the name of the session is lost because it's defined by a normal var..

How can I preserve the sessionName

Oct 10 '06 #1
Share this Question
Share on Google+
1 Reply

P: 143
Do a simple test on a new web page - do you loose the session variable(s)? if the answer is yes, then you have to turn cookies on in IE. Try that first.
Oct 10 '06 #2

Post your reply

Sign in to post your reply or Sign up for a free account.