C
Charlotte
Hi,
I have a problem with a ASP-script, can somewone help me ?
here is what I've got:
mypage.asp :
.... code ...
<%
If Request.Form("zzz") = "brussels" Then
Session("city") = "brussels"
End If
If Request.Form("zzz") = "antwerp" Then
Session("city") = "antwerp"
End If
If Request.Form("zzz") = "london" Then
Session("city") = "london"
End If
If Request.Form("zzz") = "newyork" Then
Session("city") = "newyork"
End If
%>
.... code ...
<form action="mypage.asp" method="post" name="xxx">
<table>
<tr><td><input type="checkbox" name="zzz" value="test1" <% If
Session("city") = "brussels" Then %>checked<% End If %>></td></tr>
<tr><td><input type="checkbox" name="zzz" value="test2" <% If
Session("city") = "antwerp" Then %>checked<% End If %>></td></tr>
<tr><td><input type="checkbox" name="zzz" value="test3" <% If
Session("city") = "london" Then %>checked<% End If %>></td></tr>
<tr><td><input type="checkbox" name="zzz" value="test3" <% If
Session("city") = "newyork" Then %>checked<% End If %>></td></tr>
<tr><td><input type="submit" value="submit">
</table>
</form>
.... code ...
So, when the submit-button is clicked and only 1 checkbox is checked, no
problem
the page returns and that checkbox is checked
But when 2 are 3 or ... checkboxes are checked and the page returns
none of the checkboxes are checked
so I want that the checkboxes who were checked
are still be checked after rebuilding the page
I've put a response.write session("city") and the output is (for example)
brussels, antwerp, london
of course it won't work because
If Session("city") = "brussels" Then....
and the session isn't brussels, but
brussels, antwerp, london
so I think that the session must be "split"
so afterwards I can check of the session is that city
and the checkbox of that city must be checked
can somebody give me a script that will do the job
thanks
Charlotte
I have a problem with a ASP-script, can somewone help me ?
here is what I've got:
mypage.asp :
.... code ...
<%
If Request.Form("zzz") = "brussels" Then
Session("city") = "brussels"
End If
If Request.Form("zzz") = "antwerp" Then
Session("city") = "antwerp"
End If
If Request.Form("zzz") = "london" Then
Session("city") = "london"
End If
If Request.Form("zzz") = "newyork" Then
Session("city") = "newyork"
End If
%>
.... code ...
<form action="mypage.asp" method="post" name="xxx">
<table>
<tr><td><input type="checkbox" name="zzz" value="test1" <% If
Session("city") = "brussels" Then %>checked<% End If %>></td></tr>
<tr><td><input type="checkbox" name="zzz" value="test2" <% If
Session("city") = "antwerp" Then %>checked<% End If %>></td></tr>
<tr><td><input type="checkbox" name="zzz" value="test3" <% If
Session("city") = "london" Then %>checked<% End If %>></td></tr>
<tr><td><input type="checkbox" name="zzz" value="test3" <% If
Session("city") = "newyork" Then %>checked<% End If %>></td></tr>
<tr><td><input type="submit" value="submit">
</table>
</form>
.... code ...
So, when the submit-button is clicked and only 1 checkbox is checked, no
problem
the page returns and that checkbox is checked
But when 2 are 3 or ... checkboxes are checked and the page returns
none of the checkboxes are checked
so I want that the checkboxes who were checked
are still be checked after rebuilding the page
I've put a response.write session("city") and the output is (for example)
brussels, antwerp, london
of course it won't work because
If Session("city") = "brussels" Then....
and the session isn't brussels, but
brussels, antwerp, london
so I think that the session must be "split"
so afterwards I can check of the session is that city
and the checkbox of that city must be checked
can somebody give me a script that will do the job
thanks
Charlotte