views:

59

answers:

1

Hi,

does anyone know how to link two comboboxes which are generates from a form in a way that makes the 2nd combobox dependent on the 1st one? Every time the user would change the selection in combobox #1, the options in combobox #2 would change to a predefined list of options. The potential options for both comboboxes are fixed at time of generating the html file.

Thanks for any help.

Cheers, Max

A: 

Use javascript to get selected options of #1, process the list and change #2 according to it.

With jQuery it's not that hard.

Use

$('select#id_of_1 option:selected').val();

to get the list of selected options and process this list afterwards.

sorki
I was hoping to find something that's already integrated in Django...
Max
Afaik nothing like that is builtin. You have to write your own script to do that.
sorki