Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

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>&nbsp;</th><th +bgcolor="#CCCCEE">Second_Host</th> </tr> <tr align=center> <td nowrap>@{[ $qry->textfield(-name=>'HOST_1') . '&nbsp; +' . $qry->submit(-name=>'HOST_1_LIST', -value=>'Show jobs') ]}</td> <td>&nbsp;</td> <td nowrap>@{[ $qry->textfield(-name=>'HOST_2') . '&nbsp; +' . $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>

In reply to How to retain popup_menu selection between form submission by ghosh123

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (5)
As of 2024-04-19 06:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found