in reply to storing radio button value and presetting after refresh

Summary of Problem: Your HTML form has some errors in it.

I changed your single quotes to double quotes (do not know if that is necessary) and fixed the error where you use the TYPE keyword twice in the same INPUT tag:

<input type='button' type='submit' value='Save'/>
Changed it to:
<input type="submit" name="button" value="Save">
And then I got the following output:
Parameter count: 2 'signoff' => 'review' 'button' => 'Save'

From this script:

#!/user/bin/perl use strict; use CGI; &httpHeader(); &weblog(); &httpFooter(); exit; sub httpHeader { print "Content-Type: text/html\n\n"; print "<HTML>\n"; print "<TITLE>Parameter Confirmation</TITLE>\n"; print "<BODY>\n"; } sub httpFooter { print "</BODY>\n"; print "</HTML>\n"; } sub weblog { my $cgihan = CGI::new(); my @frmprm = $cgihan->param; my $prmcnt = @frmprm; #----------------------------------------- # Debugging aid #----------------------------------------- print "<P>Parameter count: $prmcnt\n"; foreach my $frmprm (@frmprm) { my $prmval = $cgihan->param($frmprm); print "<BR>\&nbsp;\&nbsp;\&nbsp;\&nbsp;'$frmprm' => '$prmval'\ +n"; } #----------------------------------------- print "</P>\n"; return; } __END__

Perhaps this will help you get to the next stage in your experimentation?

Replies are listed 'Best First'.
Re^2: storing radio button value and presetting after refresh
by venganesan (Initiate) on Jul 30, 2013 at 23:41 UTC
    thank you so much for taking the effort and clearing out the mistakes. I have found out my error by searching through the forum and others. there is some issue with the form action tag in my html. It does not send the data to the .cgi script. Is there any modifications that i need to do to make it work? I did go through answers that said look into the httpd.conf file, and move the cgi file to cgi-bin folder. I tried them but to no avail. Also I do not have root access. So can you help me out along those lines?
      It works for me if you fix the submit button:
      <input type='button' type='submit' value='Save'/> # change to <input type='submit' value='Save'/>
      There is no short answer to the issue of where the CGI script needs to go and how to reference it from the HTML form.

      Usually this information is available from your web hosting provider.

      If you are not using a web hosting provider in the vulgar sense, but using, say, some system at work, check with your system administrator for the following:

      • Where the CGI directory is located
      • How to get a CGI script into the CGI directory
      • How to set permissions on the CGI script so it will execute when referenced by an HTML page
      • What is the qualified path to that directory from the web site you are using (in other words, how do you specify the value for the ACTION parameter)

      Good luck -- you are very close to getting stage one complete (reading the form).

      If I am reading your intentions correctly, you will have new challenges to overcome for the part where you'd like to preserve the state for the next page hit -- but one thing at a time. :-)