in reply to How to put links in a scroll box?
#!/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
|
|---|