[Templates] TT and (sticky) form handling
Jeff Anderson
captvanhalen@yahoo.com
Wed, 29 Oct 2003 14:16:43 -0800 (PST)
You can still use CGI to keep form stickieness:
[% USE CGI %]
[% CGI.start_form %]
login:
[% CGI.textfield({Name => 'login' Value =>
params.login Size => 10 Maxlength => 10}) %]<br/>
password:
[% CGI.password_field({Name => 'password'
Value => params.password Size => 10 Maxlength =>
10}) %]<br/>
[% CGI.submit({Name => 'cm' Value => 'login'
Class => 'grid'}) %]
</form>
I may be wrong, but last time i checked,
CGI.end_form was a bit ornery, so i just used a
end form tag verbatim.
Hope this helps,
jeffa
--- Jesse Sheidlower <jester@panix.com> wrote:
>
> Hi. I'm a new convert to Template Toolkit.
>
> I want to use TT for the usual form-based Web
> app,
> with the usual features for this--partly
> populating
> a form based on info stored in a database,
> keeping
> the values in place if you need to return to
> the
> form to have the user correct missing/erroneous
> values, and so forth. Up to now, I've been
> using
> CGI.pm for html generation and form handling
> (well,
> I'll continue to use it for form handling, I
> guess).
> I suppose I could use something like
> CGI::FormBuilder
> with the TT hooks, but perhaps there's another
> way.
>
> I wasn't able to find any discussion of this in
> the
> docs, or on Perlmonks, or on the last few
> months of
> this list's archives. But I assume that this
> must
> be a very common need. Can someone give me any
> pointers on how to handle this, or to any
> previous
> discussions that I might have missed?
>
> Thanks very much.
>
> Jesse Sheidlower
>
> _______________________________________________
> templates mailing list
> templates@template-toolkit.org
>
http://lists.template-toolkit.org/mailman/listinfo/templates
__________________________________
Do you Yahoo!?
Exclusive Video Premiere - Britney Spears
http://launch.yahoo.com/promos/britneyspears/