Well, the
million, zillion problem can be solved by simply changing your form generator script to show only X# of options at a time with a link to go and get more of them. For a contact list this is fairly common. I didn't bother resizing the popup form because I suspect that you really want to include more information about this user than a small window could provide. See your friendly JavaScript reference for details on open() function parameters.
#!/usr/bin/perl -w
use strict;
use CGI qw/:standard :debug/;
CGI::initialize_globals();
my $script = q(function open_popup(page) { window.open(page);return fa
+lse;});
my @names = qw/NAMES JOHN SALLY PETER SUE ANDRE/;
print header, start_html(-title=>'See a Name',
-script=>$script) ,
start_form(-name=>qq(NAMEFORM) -action=>'');
if (!param()) {
print '<select name="NAMELIST" onChange="open_popup(\'http://localho
+st/cgi-bin/bouncer.cgi?name=\' + this[this.selectedIndex].text)">' ,
( map {option($_) }@names) ,
'</select>';
}
else {
print h1("NAME RESPONSE"),
h3(fake_address(param('name')));
}
print &end_form, &end_html;
sub fake_address {
my $name = shift;
# Rewrite this to look up this information in a database or something
return($name . 'lives @ 1818 W. Refectory, New York, NY 22212');
}
1;
Celebrate Intellectual Diversity
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.