Iain L
11-16-2005, 06:31 AM
Hi,
I am trying to create a page which will enable visitors to select essay titles from a menu. This form will be Access database driven (the form script below is just a simplified version) but my problem is that I am trying to use a dynamic array to store essays selected by visitors. What happens is whenever someone selects and then selects again, the original selection is lost. So what I need is the script to correct this problem. I am basically at the very edge of my knowledge so any help would be appreciated. The script I have currently worked out is as follows:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<html>
<head>
<title>Essay Selection</title>
</head>
<body>
<p>Session ID:
<%
Session ("visitorID") = session.SessionID
response.write session("visitorID")%>
</p>
<form name="form1" method="post" action="survey2.asp">
<select name="EssayID" size="3" multiple id="EssayID">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
</select>
<input type="submit" name="Submit" value="Submit">
</form>
<p> </p>
<p><br>
<%
Dim EssayID
EssayID = Array(Request.Form("EssayID"))
EssayID= Split( Request.Form("EssayID"), ",")
Response.write("The number of Essays selected is: ")
Response.Write Ubound(EssayID)+1
Redim Preserve Essay(Ubound(EssayID)+1)
%>
</p>
</body>
</html>
Thanks.
I am trying to create a page which will enable visitors to select essay titles from a menu. This form will be Access database driven (the form script below is just a simplified version) but my problem is that I am trying to use a dynamic array to store essays selected by visitors. What happens is whenever someone selects and then selects again, the original selection is lost. So what I need is the script to correct this problem. I am basically at the very edge of my knowledge so any help would be appreciated. The script I have currently worked out is as follows:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<html>
<head>
<title>Essay Selection</title>
</head>
<body>
<p>Session ID:
<%
Session ("visitorID") = session.SessionID
response.write session("visitorID")%>
</p>
<form name="form1" method="post" action="survey2.asp">
<select name="EssayID" size="3" multiple id="EssayID">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
</select>
<input type="submit" name="Submit" value="Submit">
</form>
<p> </p>
<p><br>
<%
Dim EssayID
EssayID = Array(Request.Form("EssayID"))
EssayID= Split( Request.Form("EssayID"), ",")
Response.write("The number of Essays selected is: ")
Response.Write Ubound(EssayID)+1
Redim Preserve Essay(Ubound(EssayID)+1)
%>
</p>
</body>
</html>
Thanks.