472,127 Members | 1,898 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,127 software developers and data experts.

dynamic form - session varr get reset WHY?

1
Hi,

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..

Start>>>>>>>>>>>>
<% if flagSubs = "1" then %>



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


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

' response.write multitasks

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

SubAfdeling_rs.movefirst()
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>
</select>
</td>
<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>
</select>

</td>

<% Next 'zz
end if %>


</tr>
</table>

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

Regards..
Oct 10 '06 #1
1 1999
scripto
143 100+
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.

Similar topics

9 posts views Thread by Ken | last post: by
9 posts views Thread by Brian Burgess | last post: by
reply views Thread by Martin | last post: by
17 posts views Thread by ezb | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.