[Catalyst] CC::FormBuilder woes

RA Jones ra.jones at dpw.clara.co.uk
Fri Apr 27 16:41:13 GMT 2007

Peter Edwards wrote:
> If fields is a list reference you need something like
> [% form.fields.0.label %]
> http://www.template-toolkit.org/docs/aqua/Manual/Variables.html#Hash_Arra=
> eferences
>   =

Oh dear, that works! But it's not what I want as I can't easily force =

specific fields where I want them spatially if I have to loop over an =

array. I want some table rows to contain 3 fields, and others to contain =

one or two. I can do this if manipulating a hash(ref), but with an =

array(ref) it is very messy.

The CGI::FormBuilder::Template::TT2 documentation distinctly gives the =

impression I can retrieve fields from the form.field hash:

You can access individual fields via the |field| variable.

    For a field named...  The field data is in...
    --------------------  -----------------------
    job                   [% form.field.job   %]
    size                  [% form.field.size  %]
    email                 [% form.field.email %]

Then use eg form.field.location.label in the template. I have done this =

previously using CGI::FormBuilder in a stand-alone environment, so I =

must be missing something obvious here.
Richard Jones
Leeds, UK

This message  may  contain  confidential  and  privileged information.
If you are not  the intended  recipient please  accept our  apologies.
Please do not disclose, copy or distribute  information in this e-mail
or take any  action in reliance on its  contents: to do so is strictly
prohibited and may be unlawful. Please inform us that this message has
gone  astray  before  deleting it.  Thank  you for  your co-operation.

NHSmail is used daily by over 100,000 staff in the NHS. Over a million
messages  are sent every day by the system.  To find  out why more and
more NHS personnel are  switching to  this NHS  Connecting  for Health
system please visit www.connectingforhealth.nhs.uk/nhsmail
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20070427/67281=

More information about the Catalyst mailing list