View Full Version : Problem with onchange
stefano391544
11-06-2009, 01:36 PM
Hi everybody
i have 4 select .
Select1
Select2
Select3
Select4
select1 populate select2
select2 populate select3
select3 populate select4
All works great but when i have alla my selects popolated if i select a value in the select1 only the selct2 re-populate and Select3 and select4 display a wrong value because they don't repopulate
If i reselect a value in the select1 all other select must close to permit a repopulate from the first select
Is there a solution?
thanks for help
Sorry for my bad english ;)
Jason Byrnes
11-06-2009, 01:49 PM
You need to add a Populate List From Array behavior and Set Selected In List behavior for each child list to the onLoad event of the body tag.
stefano391544
11-09-2009, 07:06 AM
I try this but don't work :(
<body
onload=" WA_setSelectionsInChildList(MM_findObj('country'), MM_findObj('state'),0,0,false,': ')"
onload=" WA_setSelectionsInChildList(MM_findObj('state'),MM _findObj('city'),0,0,false,': ')"
>
any help?
Jason Byrnes
11-09-2009, 01:27 PM
You can only have one onload statement:
<body
onload=" WA_setSelectionsInChildList(MM_findObj('country'), MM_findObj('state'),0,0,false,': ');WA_setSelectionsInChildList(MM_findObj('state') ,MM _findObj('city'),0,0,false,': ')">
In addition to the Set Selected in List, you also need to add the Populate list from array behaviors to the onload event.
stefano391544
11-09-2009, 02:30 PM
Sorry Jason but for me don't work :(
this is my body tag
<body onload=" WA_setSelectionsInChildList(rst_stati2_WAJA,MM_fin dObj('select'),MM_findObj('country'),0,0,false,': ');WA_setSelectionsInChildList(MM_findObj('country '), MM_findObj('state'),0,0,false,': ');WA_setSelectionsInChildList(MM_findObj('state') ,MM _findObj('city'),0,0,false,': ');WA_FilterAndPopulateSubList(rst_stati2_WAJA,MM_ findObj('select'),MM_findObj('country'),0,0,false, ': ');WA_FilterAndPopulateSubList(rst_regioni_WAJA,MM _findObj('country'),MM_findObj('state'),0,0,false, ': ');WA_FilterAndPopulateSubList(rst_provincie_WAJA, MM_findObj('state'),MM_findObj('city'),0,0,false,' : ')">
my select are
1) select (populate country)
2) country (populate state)
3) state (populate city)
4) city
if i choose all the select all work great but if i re-select a country this re-populate only state and city display old wrong city.
Thanks so much for your help ;)
Jason Byrnes
11-10-2009, 11:03 AM
You need to add populate list from array behaviors for the city to the onchange event of the country list to reset the city list to nothing.
vBulletin® v3.8.1, Copyright ©2000-2012, Jelsoft Enterprises Ltd.