Click to See Complete Forum and Search --> : populate a list box dynamically based on another list box


tanuja_goturi
09-13-2005, 06:35 AM
I hava an xml created in teh following form...

<view>
<work>
<skus>
<dim1-list>
<dim1>
<value>30</value>
<dim2-list>
<dim2>
<value>30</value>
</dim2>
<dim2>
<value>32</value>
</dim2>
<dim2>
<value>34</value>
</dim2>
</dim2-list>
</dim1>
<dim1>
<value>25</value>
<dim2-list>
<dim2>
<value>42</value>
</dim2>
<dim2>
<value>28</value>
</dim2>
<dim2>
<value>31</value>
</dim2>
<dim2>
<value>32</value>
</dim2>
<dim2>
<value>35</value>
</dim2>
<dim2>
<value>36</value>
</dim2>
<dim2>
<value>37</value>
</dim2>
<dim2>
<value>37U</value>
</dim2>
<dim2>
<value>38</value>
</dim2>
<dim2>
<value>40</value>
</dim2>
<dim2>
<value>34</value>
</dim2>
<dim2>
<value>36U</value>
</dim2>
<dim2>
<value>25</value>
</dim2>
</dim2-list>
</dim1>
</dim1-list>
</skus>
</work>
</view>


In xsl, i create two list boxes 'cboDim1' for dim1 values
and two list boxes 'cboDim2' for dim2 values

in fact, i m using a recursive template to create two set of listboxes cboDim1 and cboDim2...


So, when i select a value from 'cboDim1', 'cboDim2' should get populated...

can somebody please tell me how do i get about this? And, I cannot change this xml as it is generated from Java code...

Thanks in advance,
Tanuja

Khalid Ali
09-13-2005, 01:50 PM
what you can do is create one drop box, and fill it in with the values, for second one just create javascript array object using XSLT. And when a user selects a value from the first listbox then populate the second one based on that using this array you hae created.
XSLT will out put all of the html and javascript code and then browser will take care of the rest.
There are allots of resources (http://www.webapplikations.com/pages/html_js/forms/DropDownSelectCountryShowCities.html) that show u how to create a dynamic list box based off of a first value selected from another list box.
Hope this helps..