#!/usr/bin/perl -w use strict; use CGI qw(:standard); #you can even alter the values of hidden fields based on #the values of other fields if (param('foo') eq 'change') { param('bar','a new value'); } my $txt_textfield=textfield(-name=>'foo', -size=>40); my $txt_hidden=hidden(-name=>'bar', -default=>'I do not want users to see this'); my $cmd_reset=defaults('Reset form'); my $cmd_submit=submit(-name=>'send'); print header( "text/html" ); print start_html( -title => "Sticky values in a form"); print start_form(); #defaults to method get, and action current form print <
$txt_hidden

$cmd_submit     $cmd_reset FORM print end_form(); print end_html;