entering value in listbox

05-29-2002, 10: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. ?


05-29-2002, 11: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.


05-29-2002, 11: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>"

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>
<INPUT TYPE=Submit VALUE=Submit>

<% end if %>

05-30-2002, 12:19 AM
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.....


EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum