ghosh123 has asked for the wisdom of the Perl Monks concerning the following question:
Hi Monk
I am working on a web application which looks like
Case I
Given a hostname provided in the text field if I press the
"Show jobs" button, it submits a form and loads the
same page with a popup_menu populated under the text
field and "Show jobs" button with all the jobs
running on that host.
Now I select a job in the popup_menu by a mouse click
on the values listed in the popup_menu. All fine so far.
Case II
Now to the right-hand side of this case -I gui objects, I
have another text field and "Show jobs" button. If I carry
out the same operation as I did in case-I on this
text-field and "Show jobs" at the right-hand side , it
submits the form and fetches one more popup_menu with
all the jobs running on this new host.
In addition to that the case-I text-field, submit button and popup_menu also appears on the reloaded page.
But the problem is the Case-I selection in the popup_menu is getting lost.
Please help me on how can I retain that Case-I selection as well when the page is submitted in Case-II and reloaded.
A sample code I am giving here below, the variables used in popup_menu are the usual array refs used in any such implementation and $qry is the cgi object.
<table border=0> <tr> <th bgcolor="#CCCCEE">First_Host</th><th> </th><th +bgcolor="#CCCCEE">Second_Host</th> </tr> <tr align=center> <td nowrap>@{[ $qry->textfield(-name=>'HOST_1') . ' +' . $qry->submit(-name=>'HOST_1_LIST', -value=>'Show jobs') ]}</td> <td> </td> <td nowrap>@{[ $qry->textfield(-name=>'HOST_2') . ' +' . $qry->submit(-name=>'HOST_2_LIST', -value=>'Show jobs...') ]}</td +> </tr> <tr align=center> <td bgcolor="#EEEEEE">@{[ $qry->popup_menu(-id=>'PM1', -n +ame=>'PM1_JOBS', -size=>10, -values=>$old_values, -labels=>$old_label +s, -multiple=>'false', -override=>'true', -onChange=>"fetchjobs(id,'' +,'','')") ]}</td> <td bgcolor="#EEEEEE">@{[ $qry->popup_menu(-id=>'PM2', -nam +e=>'PM2_JOBS', -size=>10, -values=>$new_values, -labels=>$new_labels, + -override=>'true', -onChange=>"fetchjobs(id,'','', '')") ]}</ +td> </tr> </table>
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: How to retain popup_menu selection between form submission
by Anonymous Monk on Jul 25, 2014 at 07:35 UTC | |
Re: How to retain popup_menu selection between form submission
by builat (Monk) on Jul 25, 2014 at 16:39 UTC |