I'm a php/mysql developer and struggle when it comes to javascript !
I've looked all over for a solution but am rubbish at adapting javascript
I've got two select dropdowns in a form
The first picks an item and the second needs to auto update to show which colours that item comes in
(I've done it before by resubmitting the page with php via an auto submit - which is ugly)
Ok - I've managed to convert all my colours into a multi dimensional javascript array, so it looks like:
Expand|Select|Wrap|Line Numbers
- colwayarray[22] = '<OPTION VALUE=18 >Daisy pink</OPTION><OPTION VALUE=17 >Pale aqua</OPTION>';
- colwayarray[26] = '<OPTION VALUE=22 >Sea splash</OPTION><OPTION VALUE=19 >Tangerine</OPTION>';
(the first select is built when the php builds the page )
um - now I havent got a clue how to get the second dropdown to autopopulate when the first dropdown is changed with an
onclick -
I think it must be fairly simple ..
I can access the required option string with this
Expand|Select|Wrap|Line Numbers
- <script language=javascript>
- document.write(colwayarray[66]);
- </script>
any help much appreciated !