bar10der has asked for the wisdom of the Perl Monks concerning the following question:
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)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Submitting form when drop down value changes
by castaway (Parson) on Jul 05, 2005 at 11:38 UTC | |
|
Re: Submitting form when drop down value changes
by Samy_rio (Vicar) on Jul 05, 2005 at 12:10 UTC | |
|
Re: Submitting form when drop down value changes
by ghenry (Vicar) on Jul 05, 2005 at 11:14 UTC | |
|
Re: Submitting form when drop down value changes
by cbrandtbuffalo (Deacon) on Jul 05, 2005 at 16:46 UTC |