PDA

View Full Version : Dynamic values between <select> JS & ASP


Mhtml
09-12-2002, 11:10 AM
Hi, I'm using an asp script to get all the folder names and file names in a directory and create a selection form from it.

How would I go about moving values from one select form to another?

If for some reason you need to look at the ASP script here it is..

<%
Dim fso, f, f1, fc, s, fk, f2, l
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.GetFolder(Server.MapPath("."))
Set fc = f.SubFolders
For Each f1 in fc
s = s & "<option>" & f1.name & "</option>"
Next

Set fc = f.Files
For Each f1 in fc
s = s & "<option>" & f1.name & "</option>"
Next
%>
<select size="12">
<%=s%>
</select>

shvetak
09-12-2002, 11:18 AM
Do you want two List boxes, one pre-filled when the page loads and that when you click one value from the first listbox, the option should be deleted from the first one and the second one should be populated with that value??

Is this what you mean??

Mhtml
09-12-2002, 11:24 AM
you hit the nail on the head, although I prob. should have mentioned they should be moved (deleted , recreated) by clicking buttons.

<input type="button" name="add" value="add">
<input type="button" name="remove" value="remove">

Mhtml
09-13-2002, 08:26 AM
does anyone know of a site which may have a tutorial & or a script for this?

Mhtml
09-13-2002, 11:51 AM
This does exactly what I need to happen how can I use the script? (i really suck at js)
http://www.mattkruse.com/javascript/selectbox/source.html