P
Pascal Ehlert
Hi group!
After my first post a few days ago and your advice not to use the
Prototype Framework (which indeed was a good idea! ;-)) I rewrote my
script for dynamic select lists.
This is what it looks like now: http://pastie.caboo.se/140953 (I know
it's messy, but I don't see another way)
Let me explain how it works in short.
First it get's all select elements with classes dynamic_select and
parent in one array and the related child elements with classes
dynamic_select and child in another.
Then I loop through them and extract the options into
grouped_options_store and store the index as the rel attribute of the
parent element.
When the value now changes it determines the text of the selected
parent item and looks for an optgroup with that text as a label.
If it can find one it inserts thoses options from grouped_options_store
into the second list.
Unfortunately I'm having the exact same problem as with the old
version, it works fine in Firefox and Safari but when I select a parent
item in the first list the second list just doesn't change.
It displays the unformatted optgroups from the markup.
Here is a live example again:
http://pascal.hacksrus.net/dev/sandbox.html
I hope you can help me out this time!
Many thanks in advance
Pascal
After my first post a few days ago and your advice not to use the
Prototype Framework (which indeed was a good idea! ;-)) I rewrote my
script for dynamic select lists.
This is what it looks like now: http://pastie.caboo.se/140953 (I know
it's messy, but I don't see another way)
Let me explain how it works in short.
First it get's all select elements with classes dynamic_select and
parent in one array and the related child elements with classes
dynamic_select and child in another.
Then I loop through them and extract the options into
grouped_options_store and store the index as the rel attribute of the
parent element.
When the value now changes it determines the text of the selected
parent item and looks for an optgroup with that text as a label.
If it can find one it inserts thoses options from grouped_options_store
into the second list.
Unfortunately I'm having the exact same problem as with the old
version, it works fine in Firefox and Safari but when I select a parent
item in the first list the second list just doesn't change.
It displays the unformatted optgroups from the markup.
Here is a live example again:
http://pascal.hacksrus.net/dev/sandbox.html
I hope you can help me out this time!
Many thanks in advance
Pascal