in reply to Re^2: How to store the value of a Javascript function as a Perl variable
in thread How to store the value of a Javascript function as a Perl variable
poj#!perl use strict; use CGI; use CGI::Carp 'fatalsToBrowser'; # remove for prod my %groupname = ( ''=>'', 1=>'11111', 2=>'22222', 3=>'33333', 4=>'44444', ); my $q = new CGI; my $group = $q->param('group'); print $q->header,$q->start_html('test'); print qq! <form>Select Group <select name="group" onChange="submit()">!; for my $id (sort keys %groupname){ my $sel = ($id eq $group) ? 'SELECTED' : ''; print qq!<option value="$id" $sel>$groupname{$id}</option>!; } print q!</select></form><hr/>!; #Information Table if ($group){ print qq! <table border="1" cellpadding="10" cellspacing="0"> <h3> $groupname{$group} </h3> <tr> <td>Members of group: $group</td> <td>Jobs that group $group can do:</td> </tr> <tr> <td>Text on the way</td> <td>Text on the way</td> </tr> </table>!; } else { print "<h3>SELECT GROUP</h3>"; } print $q->end_html;
|
|---|