Dependent Selects in prototype

I have two <select>s with the same <option>s, and I need - using prototype - that when selecting an option in one of them, the same option is removed from the other select and additionally the latter must mantain its previously selected option.

Any clues ? Is there a better way than remembering the last item selected, recreate the options array, an reselecting the item ?

Thanks!

Answers


You can 'remove' the item from the other select, but you need to specify it by its index, and you'll still need to remember the selected item, and recalculate its index after the removal. So it's slightly better than recreating the array, but not much better.


Need Your Help

cURL feedback with some value (true/false)

php curl feedback

So I was wondering if it is possible got get a value back as feedback after sending a cURL request. I got a project going on where I send XML data to a Press office, where they check if the data is...

PHP Parsing Problem - &nbsp; and Â

php html parsing character-encoding

When I try to parse some html that has &amp;nbsp; sprinkled through it and then echo it, the &amp;nbsp; "turns into" this character: Â. Also, html_entity_decode() and str_replace() doesn't change i...