I am using CGI-Application and HTML-Template to create a form where values from database are extracted and displayed to uers. My form requires 2 dropdown lists e.g. list1 and list2. Elements in list2 are controlled by selected value in list1.
So when user selects an element from list1, form is submitted and new values are populated in drop down list2 but elements in list1 goes back to default list order where as i want the selected item to be the 1st item in drop down. Here is html for drop down:-
<tr bgcolor="#ffffff"> <td class="colhead">List1</td> <td><select name="list1" size="1" style="background-color:#DDD;" onc +hange="admin.submit();"> <!-- TMPL_LOOP NAME=depts --> <option value="<!-- TMPL_VAR NAME=id -->"><!-- TMPL_VAR NAME=dn -- +> <!-- /TMPL_LOOP --> </select> </td> </tr> <tr bgcolor="#ffffff"> <td class="colhead">List2</td> <td><select name="list2" size="1" style="background-color:#DDD;" onc +hange="admin.submit();"> <!-- TMPL_LOOP NAME=emps --> <option value="<!-- TMPL_VAR NAME=id -->"><!-- TMPL_VAR NAME=ename + --> <!-- /TMPL_LOOP --> </select> </td> </tr> .... ....
Considered (gellyfish): delete or mark OT this is a Javascript Question
Unconsidered (holli): Enough Keep votes (Keep/Edit/Delete : 11/12/6)
In reply to Submitting form when drop down value changes by bar10der
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |