Siirry sisältöön
Menu
Sinun on rekisteröidyttävä, jotta voit olla vuorovaikutuksessa yhteisön kanssa.
Tämä kysymys on merkitty
1820 Näkymät

Hi All,

I have created a the below html select that uses a for loop to populate the options.  I have this setup inside a snippet and it works. My question, is it possible to have a second select that is based on the first selects users selection. So user selects a school and all students from that school are populated into the second html select for the user to pick from? All in the same snippet? (School model has access to the student model.) Hope this makes sense. Thank you!


 select name="schools_select" id="student_select" 

option t-att-value="0" >Select a Student

t t-foreach="schools_id" t-as="school_ids" 

  t t-foreach="school_ids.school_list_ids" t-as="all_school_ids" 

option 

t t-esc="all_school_ids.name"/ 

/option 

/t 

/t 

 /select 

Avatar
Hylkää
Aiheeseen liittyviä artikkeleita Vastaukset Näkymät Toimenpide
0
marrask. 23
1400
1
elok. 23
4470
1
kesäk. 23
3399
1
kesäk. 23
1446
0
huhtik. 23
103