hi monks
I am trying to submit the CGI form with multiple buttons along with submit button. My intention is to select one of the preset and press SUBMIT button. This isn't working as preset button value is not passed or didn't get submit when I actually press the SUBMIT button. I am getting values for rest of the form fields (not included in the script). Can somebody help me? Thank you.
use strict; use CGI; my $q = new CGI(); print $q->header(); print $q->start_html(-title => 'Test HTML'); my $namescript = 'http://' . $ENV{'SERVER_NAME'} . (($ENV{'SERVER_PORT +'} != 80) ? ":$ENV{'SERVER_PORT'}" : "") . $ENV{'SCRIPT_NAME'}; print $q->startform("POST", $namescript); my %presets = ( 'preset_appleid' => 'APPLEID', 'preset_default' =>'DEFAULT', 'preset_ntlm' =>'NLTM', 'preset_security' => 'SECURITYQ', 'preset_web16' => 'Web Site (16 Chars)', 'preset_web32' => 'Web Site (32 Chars)', 'preset_wifi' => 'WIFI', 'preset_xkcd' => 'XKCD', ); foreach my $preset ( keys %presets ) { print $q->button( -name => $preset, -id => $preset, -value => $presets{$preset}, ); } print $q->submit(-value => 'SUBMIT'); print $q->endform; print $q->end_html();
In reply to How to handle multiple buttons inside CGI form by doubledecker
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |