Chained Selects Step-by-step: Implement list group for select list arrays
Many server side scripts support form element arrays and usually those elements are named as, for example, cars:
<select name="cars"> ... <select name="cars">
so that the server script can refer to them as cars, cars, etc.
If you have multiple sets of select lists that share the same list content, like the following:
<select name="makes"> <select name="types"> <select name="models"> ... <select name="makes"> <select name="types"> <select name="models">
and your server script would refer to them as makes, types and models, ..., makes[n], types[n] and models[n], then you can use the initListGroups() call once instead of using the initListGroup() call many times, like this:
<body onload="initListGroups('vehicles', document.forms['makes'], document.forms['types'], document.forms['models'])">
The 'cookie-name' and callback-function parameters will also work with the initListGroups() call.
Click [ here ] to see a demo page.
[ Set up option groups in a list group ] [ Back to main page ]
# # #