entering value in listbox

waqas
05-29-2002, 09:43 PM
how can i insert/append a value in a listbox using vbscript and then retrieve all the values in the listbox when i submit the form. ?

waqas

waqas
05-29-2002, 10:36 PM
okay i have found out how to insert the values dynamically to the listbox but now the problem how to retrieve all these values after submitting a form.....In asp if i use request.form("list1"), it will give the value of only the selected one.....but i want to retrieve all the values.

waqas

Rezner
05-29-2002, 10:58 PM
Here is an example of a listbox allowing multiple selections. You should paste this script on a page called "test.asp", as it POSTs to itself.

To demonstrate it, select multiple items in the listbox and hit the Submit button:<%
if request.querystring("view") = "list" then

for x = 1 to 3
Response.Write x & ":" & Request.form("Test") & "<br>"
next

else %>

<FORM METHOD=POST ACTION="test.asp?view=list" name=form1>
<select name="Test" size="10" multiple>
<option name="lst1" value="1">ROW 1</option>
<option name="lst2" value="2">ROW 2</option>
<option name="lst3" value="3">ROW 3</option>
</select>
<br>
<INPUT TYPE=Submit VALUE=Submit>
</FORM>

<% end if %>

waqas
05-29-2002, 11:19 PM
well it only works if i select all the values in the listbox..but i want it to be auto selected when i submit the form.....

waqas

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum