Not working for me..
Hello (sorry for the necropost, but it is too applicable to start another thread...)
I have setup a parent/child dynamic dropdown on an DA update form.
Using the onLoad attached to the body tag as follows works perfectly:
<body onload="WA_setSelectionsInChildList(MM_findObj('uinfo_country'),<?php echo $row_WADAusers['uinfo_country']; ?>);WA_FilterAndPopulateSubList(WADADynListprov_WAJA,MM_findObj('uinfo_country'),MM_findObj('uinfo_prov'),0,0,false,': ');WA_setSelectionsInChildList(MM_findObj('uinfo_prov'),<?php echo $row_WADAusers['uinfo_prov']; ?>)">
However, when I add the template this code is removed. Following the instructions throughout this post I modified the code to the following and added it before the last end of instance editable.
<script type="text/javascript">
WA_setSelectionsInChildList(MM_findObj('uinfo_country'),<?php echo $row_WADAusers['uinfo_country']; ?>);WA_FilterAndPopulateSubList(WADADynListprov_WAJA,MM_findObj('uinfo_country'),MM_findObj('uinfo_prov'),0,0,false,': ');WA_setSelectionsInChildList(MM_findObj('uinfo_prov'),<?php echo $row_WADAusers['uinfo_prov']; ?>)
</script>
This has no effect on either dropdown.
Removing the first part which makes sure the parent is selected:
<script type="text/javascript">
WA_FilterAndPopulateSubList(WADADynListprov_WAJA,MM_findObj('uinfo_country'),MM_findObj('uinfo_prov'),0,0,false,': ');WA_setSelectionsInChildList(MM_findObj('uinfo_prov'),<?php echo $row_WADAusers['uinfo_prov']; ?>)
</script>
Allows the parent to be selected properly (I assume from the DA behaviour), the child list is populated, however, the correct child is not being selected as the original value.
Any idea why?