473,511 Members | 14,951 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

select2select

Hi

I have to do something like this :

I have 1 combolist - atributes of devices

and copy value and text to second select (multiple list size 10)

like this:

------------------------------------------------
function sel2sel(home,target) {
if(home.value != '' ) {
var targetOpt= new Option();
targetOpt.text = home.options[home.selectedIndex].text;
targetOpt.value= home.options[home.selectedIndex].value;
target.options[target.options.length] = targetOpt;
}
alert(''+targetOpt.text);
}
<select name="featureList" onChange="sel2sel(featureList,selList);">
<option>feature 1</option>
<option>feature 2</option>
<option>feature 3</option>
</select>

<select name="selList" size="10" multiple>
</select>
--------------------------------------------

Everything is copying to second SElect but just on the screen.
When I submit form nothing is passed throgh $_POST

What's wrong?

Could you help me

Jaro


Jul 23 '05 #1
1 1179
Jaras wrote:
I have 1 combolist - atributes of devices
and copy value and text to second select (multiple list size 10)
Everything is copying to second SElect but just on the screen.
When I submit form nothing is passed throgh $_POST


Only SELECTED options are sent to the server. You must select all options
before submitting.

Or, use a solution like mine, for this exact purpose:
http://www.javascripttoolbox.com/optiontransfer/

--
Matt Kruse
http://www.JavascriptToolbox.com
Jul 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.