venganesan has asked for the wisdom of the Perl Monks concerning the following question:
I have a html table that has 2 radio buttons for every row and a save button. I want to store the value of the radio button when saved and preset the value when the page is revisited.This is the html code I have written
<form action='table_extract.pl' method = 'get'> <td><input type='radio' name='signoff' value = 'approve'>Appro +ve<br> <input type='radio' name='signoff' value='review'>Review</td> <td><input type='button' type='submit' value='Save'/></td></form>
This is what is in table_extract.pl
#!/usr/bin/perl -wT use CGI qw(:standard); use CGI::Carp qw(warningsToBrowser fatalsToBrowser); use strict; use Fcntl qw(:flock :seek); my $outfile = "poll.out"; if (param('signoff')) { open(OUT, ">>$outfile") or die("outfile issue"); flock(OUT, LOCK_EX); seek(OUT, 0, SEEK_END); print OUT param('signoff'),"\n"; close(OUT); }else{die ("param issue");}
This is just first part of the problem. I was not able to find any output in console or in poll.out. Once I read the values, I need to preset the values to the radio buttons that was saved by the user in the previous visit.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: storing radio button value and presetting after refresh
by Corion (Patriarch) on Jul 30, 2013 at 18:26 UTC | |
by venganesan (Initiate) on Jul 30, 2013 at 18:29 UTC | |
Re: storing radio button value and presetting after refresh
by marinersk (Priest) on Jul 30, 2013 at 22:01 UTC | |
by venganesan (Initiate) on Jul 30, 2013 at 23:41 UTC | |
by Anonymous Monk on Jul 31, 2013 at 12:15 UTC | |
by marinersk (Priest) on Jul 31, 2013 at 14:11 UTC |