Forum Moderators: open
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.
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;