form JS assistance needed

wxdqz

New Member
I'll list the HTML and the JS I'm using and see if anyone can give me a hint on how to do the thing correctly.

HTML -->

<form method="post" name="form">
...
<input type="hidden" name="orderList[0]" value=http://www.webdeveloper.com/forum/archive/index.php/"Bob">
<input type="hidden" name="orderList[1]" value="Mary">
<input type="hidden" name="orderList[2]" value="Jane">
...
<input type="button" value="submit" onClick="doList()">
</form>


JavaScript -->

function doOrder() {
for (i=0; i <= 3; i++) {
form.orderList.value = list.options.text;
}
document.form.submit();
}


So, what happens is I have another JS routine that allows the user to re-order the items. When they hit Submit button, it runs the doOrder() function before submitting the form. I know the problem is in the "form.orderList" in the middle of the function, but I don't know how you use JS to populate an array like that. Any ideas?
 
Back
Top