Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: HTML::FillInForm vs. checked by default checkboxes

by bradcathey (Prior)
on Feb 18, 2009 at 19:32 UTC ( [id://744861]=note: print w/replies, xml ) Need Help??


in reply to HTML::FillInForm vs. checked by default checkboxes

I've been using HTML::FillInForm for ages now, but only in conjunction with HTML::Template and the cool plug-ing that comes with CGI::Application. Anyway, pulling from the docs:

my $output = HTML::FillInForm->fill( \$html, \%fifvalues);

If look at the above, note 3 main concepts:

  1. You need your HTML in a variable* (e.g., $html built by hand, CGI, or HTML::Template in your Perl script).
  2. You need the form value(s) in a variable (I always use a hash ref because I'm always pulling from a database, e.g., $fifvalues->{'gender' => 'male'}) assuming your radio button is named "gender" and one of the values is "male".
  3. Then you will need to print the $output, e.g., print "Content-type: text/html\n\n"; print $output;

So, forget checked, it will be done for you. But just try it, that's how I learned.

*Update: You can just reference an actual static html page with a form, negating the need to build it with the script.

—Brad
"The important work of moving the world forward does not wait to be done by perfect men." George Eliot

Replies are listed 'Best First'.
Re^2: HTML::FillInForm vs. checked by default checkboxes
by kappa (Chaplain) on Feb 19, 2009 at 13:40 UTC
    Well, thanks, but I need checkboxes checked by default in HTML source.
    --kap

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://744861]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (3)
As of 2024-04-19 20:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found