Forum Moderators: open

Message Too Old, No Replies

Displaying, Selecting and Ordering File Names

         

Butch Cassidy

9:34 pm on May 12, 2006 (gmt 0)

10+ Year Member



My web page needs to do the following:

1. display a list of file names supplied by the server,
2. allow the user to select one or more file names,
3. allow the user to change the order of the selected
names,
4. on Submit, send the ordered list back to the server.

I know how to handle 1. 2. and 4., but 3 is new to me. I am fairly new to JavaScript: I have used it to validate user input, but not to manipulate data in this way. Is there a recipe, how-to or tutorial somewhere I could use to get me started?

Thanks in advance for your help.

MichaelBluejay

11:00 am on May 14, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I think this is either going to be difficult, or not user-friendly. Here's one that's easy but kind of ugly.

Since you say the data is supplied by the server, I'm assuming it can output a page like this:

<form name=form><table>
<tr><td> UP </td> <td><input name=f1 value=filename1> </td> <td> DOWN </td> </tr>
<tr><td> UP </td> <td><input name=f2 value=filename2> </td> <td> DOWN </td> </tr>
<tr><td> UP </td> <td><input name=f3 value=filename3> </td> <td> DOWN </td> </tr>
</table></form>

Where UP and DOWN are listed in the table, you have an image of an arrow pointing up or down, which an onclick that calls a function to move all the data around. For example:

temp = document.form.f1.value;
document.form.f1.value = document.form.f2.value;
document.form.f2.value = temp;