FAQ
Ok, problem solved! Phew!

I will post all the files in downloadable form
at "http://www.xm5design.com/" sometime tomorrow.
After I wake up!

Thanks Carl! You have made my day(night).

Now, I can go to sleep!

George

Solution: The "simple_get.cgi" script must look like this:
===============================
1 #!/usr/bin/perl
2 #
3 # @(#)
4 #
5 use strict;
6 use warnings;
7 use HTML::FormFu;
8 use YAML::Syck qw( Load );
9 use CGI qw(:standard);
10 use HTML::Template;
11
12 use vars qw ($cgi_query $template $form $formret $TimeFormat);
13 use vars qw ($RstrLdate $RstrLtime);
14 #
15 #
16 my($query, $template, $formret);
17 my($template_out, $CGI_query);
18
19 #
20 # Note: When calling "new CGI" the variables (as passed by apache) will fill in the
21 # query and each variable can be accessed via: $form->param_value('variable_name_in_form')
22 $CGI_query = new CGI;
23 print $CGI_query->header();
24 #
25 # open the HTML template
26 $form = HTML::FormFu->new;
27 $form->load_config_file('/opt/http/forms/simple.yml');
28 $form->action("/cgi-bin/simple_get.cgi");
29 $form->method("post");
30 $form->indicator("textvar");
31 $form->query( $CGI_query ) ;
32 $form->process();
33
34 $template = HTML::Template->new(filename => '/opt/http/templates/simple.shtml');
35 #
36 # fill in some parameters in the template
37 if ( $form->submitted ) {
38 `/bin/echo "proc: submittted" >>/tmp/http.log`;
39 #
40 $template->param( form => $form->param_value('textvar') );
41 $template_out = $template->output;
42 print $template_out . "\n";
43 } else {
44 `/bin/echo "proc: Not-submittted" >>/tmp/http.log`;
45 $template->param( form => $form );
46 $template_out = $template->output;
47 print $template_out . "\n";
48 }
===================================
On 5/25/11 3:41 AM, George Hrysanthopoulos wrote:
Ok, what would be an example of a "$query object".

I know, I know, but Google is not helping me!

George
On 5/25/11 3:27 AM, Carl Franks wrote:

Ah, yes -in the cgi handling the submission, process() needs to be passed the $query object
On 25 May 2011 08:19, "George Hrysanthopoulos" wrote:
Carl,

You are quite right. However, even when I did:

27 $form->indicator("textvar");

I still got same result. Actually I had a button there
called: "submit" but I removed it for the sake
of simplicity.

How is my overall logic?

-George
On 5/25/11 3:04 AM, Carl Franks wrote:
First, the yml file: simple.yml
======================
---
auto_fieldset: 1
elements:
- type: Text
name: textvar
And last, the processing CGI file: simple_get.cgi
======================
27 $form->indicator("submit");
indicator('submit') tells process() that a form must have a value for
the field 'submit'.
Your form config doesn't have a 'submit' field/button.
So $form->submitted() will always be false.

Carl

_______________________________________________
HTML-FormFu mailing list
HTML-FormFu@lists.scsys.co.uk > >> http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/html-formfu

_______________________________________________
HTML-FormFu mailing list
HTML-FormFu@lists.scsys.co.uk > > http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/html-formfu

_______________________________________________
HTML-FormFu mailing list
HTML-FormFu@lists.scsys.co.uk
http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/html-formfu

_______________________________________________
HTML-FormFu mailing list
HTML-FormFu@lists.scsys.co.uk
http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/html-formfu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/html-formfu/attachments/20110525/17b27582/attachment.htm

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 9 of 14 | next ›
Discussion Overview
grouphtml-formfu @
categoriesperl, catalyst
postedMay 25, '11 at 6:38a
activeMay 30, '11 at 12:21a
posts14
users3
websitemetacpan.org...

People

Translate

site design / logo © 2022 Grokbase