Click to See Complete Forum and Search --> : Menu Swapper anyone using this?


needhelpitc
01-06-2003, 06:39 PM
I can incorporate the code with no problem but I can never properly pass the values in the form to the next page for processing. Anyone have any ideas? I have not changed any of the field names, etc.

I have seen other examples similiar to this code and I am having the same issue.


Example:
http://www.philwebb.com/code/list_box.asp

Thanks,
itc

khalidali63
01-06-2003, 10:49 PM
The sample URL you provided is passing infromation using .asp page(Server side code).
Your question does not specify that if thats what you intend to do?

Anyways,if you do not use serverside at this level and want to send form info to another webpage then there are 2 ways that I am aware of.
1.pass the information to the next page using
document.location.href method and if this form is in a child window then you can pass this info using
opener.document.formName.formElement.value

I hope it made some sense.

Khalid

Herb
01-15-2003, 06:11 PM
Dear needhelpitc


I found this comment from the hyperlink you gave:

"Note: The function move merely moves the items back and forth. This function alone will not select any of the items to be sent along with the post. In other words nothing will be sent in the form when you submit it unless some items are selected (highlighted) or additional Javascript code it used. In this page I have added the function selectAll which loops through the righthand box and selects all the items before the form is submitted. This is much more intuitive for the user. The function selectAll is called in the onClick event of the submit button. "

Here's the code left out from the javascriptsource code - add it to the script tag.

function selectAll(box) {
for(var i=0; i<box.length; i++) {
box[i].selected = true;
}
}



You must also use the OnClick event in your submit tag

OnClick="selectAll(document.combo_box.list2);"

should work after that - glad you posted this question - i was fumbling for awhile and your link sent me to the answer - yet so obvious ... no items in the select box are highlighted!

Herb