PDA

View Full Version : Radio Buttons -saving to file


muaythai
02-22-2005, 12:38 PM
Hi,

Was wondering if you can help. I need to update some code to have some radiobuttons(yes and no). I need it so that it will save the info from the radio buttons to a file.(so if you click yes...next time you bring the page up the radiobutton will be on yes)
I'm finding this a bit complicated as I need to update someone elses code. Can anyone recommend a way I can do this:

Here is the code so far:

sub ViewChecklist{


print "<hr><h1>CHECKLIST (<i>$checklist</i>)<p>UNIMPLEMENTED AS YET.</h1>";

my $checklist2 = $repos->get_online_path_($checklist);

my $STATE_DIR = "$checklist2/STATES"; #15/2/05



my $query = new CGI;

#########This is where i get it wrong###########

open(SAVEDSTATE, ">$STATE_DIR") || return;

restore_parameters(\*SAVEDSTATE);

close SAVEDSTATE;

#################################################

my ($JSCRIPT) = &javascript;

print "<html><head><title>Checklist</title></head><body bgcolor=$background_colour>";
</pre>";

if ( $query->param() ){

my $apple_updated = $query->param('apple_updated');

my $orange_checked = $query->param('orange_checked');

</pre>;

};
##########################################
#########################################
print $query->startform(-method => 'get');
my $me = "http://##########" . $query->script_name();

my $table_colour = "ghostwhite";
print "<table bgcolor=\"white\" cellpadding=5>";

####################################
my @labels = ('yes', 'no');
my @labels1 = ('yes', 'no', 'Na');
my @labels2 = ('yes', 'no', 'Job done');
print "<tr bgcolor=$table_colour>";
#&icon_cell;
print "<td><B>Apples updated? </B></td><td>";
print $query->radio_group(-'name' => 'apple_updated',
-'values' => \@labels,
-'default' => 'no'
);
#####################################
my @labels = ('yes', 'no');
print "<tr bgcolor=$table_colour>";
#&icon_cell;
print "<td><B>Orange checked? </B></td><td>";
print $query->radio_group(-'name' => 'orange_checked',
-'values' => \@labels,
-'default' => 'no'
);


###################################
print "</table>";

exit;

}