.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "HTML::FormHandler::Manual::Reference 3pm" .TH HTML::FormHandler::Manual::Reference 3pm "2022-03-25" "perl v5.34.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" HTML::FormHandler::Manual::Reference \- concise reference .SH "VERSION" .IX Header "VERSION" version 0.40068 .SH "DESCRIPTION" .IX Header "DESCRIPTION" Manual Index .PP This is a concise reference of HTML::FormHandler. .PP HTML::FormHandler has a lot of options and many ways to customize your forms. More complete documentation can be found in the rest of the manual as HTML::FormHandler::Manual and in HTML::FormHandler, HTML::FormHandler::Field, HTML::FormHandler::Model::DBIC, HTML::FormHandler::Render::Simple, and in the individual field classes. .SH "Form" .IX Header "Form" .SS "Form Attributes" .IX Subsection "Form Attributes" .Vb 2 \& params HTTP parameters; if present validation will be attempted \& name Form name. Used in \*(Aqid\*(Aq of form element \& \& field_name_space Where to search for fields \& widget_name_space Where to search for widgets \& \& language handle For MakeText \& ctx Application context for your use \& \& init_object For default values instead of $item \& dependency Array of arrays of field names. If one name has a value, all \& fields in the list are set to \*(Aqrequired\*(Aq \& \& fields Field array \& sorted_fields The sorted array of fields \& field( $name ) Returns a field object \& has_field Moose\-y sugar for declaring fields \& field_list Non\-moose\-y way to define fields \& \& clear Resets state. Used in persistent forms. \& value Returns a hashref of values (with accessor keys) \& fif Returns a hashref for filling in form .Ve .SS "Form database attributes" .IX Subsection "Form database attributes" .Vb 4 \& item DB row object \& item_class Class of db item \& item_id Primary key of db item \& schema Schema of item \& \& Also \*(Aqupdate_model\*(Aq sub .Ve .SS "Form processing" .IX Subsection "Form processing" .Vb 5 \& process Sets up form, validates, updates model \& run Returns a result object and clears form \& update_field_list Updates to fields on process \& posted Flag to say whether or not to validate, instead of \& depending on presence of params .Ve .PP \fIValidation\fR .IX Subsection "Validation" .PP .Vb 7 \& validate Sub for validation after individual fields are validated \& validate_model Sub for additional database type validation \& validated Flag that form has validated \& is_valid Synonym of \*(Aqvalidated\*(Aq \& ran_validation Flag that validation has already been run \& dependency Set groups of fields that are set to required if one is present \& validate_$fieldname Validation routine for field (also \*(Aqvalidate_method\*(Aq) .Ve .PP \fIErrors\fR .IX Subsection "Errors" .PP .Vb 5 \& has_errors True if any field has errors \& num_errors The number of errors (field errors + form errors) \& error_fields An array of fields with errors \& errors Returns an array of all errors \& error_field_names Returns an array of field names with errors .Ve .PP \fIForm Methods and process hooks\fR .IX Subsection "Form Methods and process hooks" .PP .Vb 5 \& update_model To perform additional database actions on update \& update_fields Sub providing convenient place to update fields on \*(Aqprocess\*(Aq \& update_subfields Sub providing place to update fields on Build (useful for \& roles and compound field classes) \& init_object can be a method instead of an attribute .Ve .PP \fIForm Rendering\fR .IX Subsection "Form Rendering" .PP .Vb 10 \& html_prefix Flag to prefix html field names with the form name. \& Useful for multiple instances of the same form \& do_form_wrapper flag to wrap form. (build_do_form_wrapper) \& form_tags Various strings and flags used by rendering \& form_element_attr For arbitrary html attributes in the \*(Aqform\*(Aq tag \& form_element_class Arrayref of classes for \*(Aqclass="..."\*(Aq in form element \& form_wrapper_attr For arbitrary html attributes on the form wrapper \& form_wrapper_class Arrayref of classes for \*(Aqclass="..."\*(Aq in form wrapper \& http_method For storing \*(Aqpost\*(Aq or \*(Aqget\*(Aq \& action Store the form \*(Aqaction\*(Aq on submission. No default value. \& enctype Request enctype \& uuid generates a string containing an HTML field with UUID \& style adds a \*(Aqstyle\*(Aq attribute to the form tag \& id the form tag \*(Aqid\*(Aq attribute is set to the form name \& html_attributes hook that allows customizing html attributes (form & field) .Ve .SS "Field specific form methods" .IX Subsection "Field specific form methods" .Vb 3 \& options_$fieldname Sub returning options array (also \*(Aqoptions_method\*(Aq) \& validate_$fieldname Validation routine for field (also \*(Aqvalidate_method\*(Aq) \& default_$fieldname Set default for field (also \*(Aqdefault_method\*(Aq) .Ve .SH "Fields" .IX Header "Fields" .SS "Field attributes" .IX Subsection "Field attributes" .Vb 3 \& name Field name. Must be the same as database column name or rel \& type Field type. From a Field class: \*(AqText\*(Aq, \*(AqSelect\*(Aq, etc \& order Set the order for fields. Default order is set by FH. \& \& dump For debugging \& active Arrayref of fields to set active \& is_active \& inactive Arrayref of fields to set inactive \& is_inactive \& input_without_param The value of the field if there is no input from the submitted form \& \& default Default value for the field \& default_method Coderef to set default or \*(Aqdefault_$fieldname\*(Aq (by default) \& not_nullable Don\*(Aqt convert an empty field (\*(Aq\*(Aq, etc) to undef \& \& trim Transform to trim the field \& deflation Function to deflate the field (in \*(Aqapply\*(Aq) (opposite of transform) \& deflate_method Coderef to deflate the field (for filling in the form) \& inflate_method Coderef to inflate the field (before validation) \& inflate_default_method Coderef to inflate value from item/init_object \& deflate_value_method Coderef to deflate value after validation \& fif_from_value Flag to use \*(Aqvalue\*(Aq of field for \*(Aqfif\*(Aq. \& \& password Remove from params and do not display in forms. .Ve .SS "Select fields" .IX Subsection "Select fields" .Vb 5 \& options Sorted array of hashes; keys: "value", "label" \& options_method \& label_column Column to use for labels (default: name) \& active_column Which values to list in options \& sort_column Column to use for sorting (default: label_column) .Ve .SS "Field errors" .IX Subsection "Field errors" .Vb 3 \& errors Errors associated with this field \& (also num_errors, clear_errors, has_errors, add_error) \& messages Hashref of message identifiers and text .Ve .SS "Field validation" .IX Subsection "Field validation" .Vb 10 \& apply Array of constraint/coercion/transformation actions \& ( type, check, transform, message, when ) \& validate_method Validation coderef, or \*(Aqvalidate_$fieldname\*(Aq in form (default) \& required Field is required \& required_when Takes a hashref of field name keys and values \& missing Flag set when a \*(Aqrequired\*(Aq or \*(Aqrequired_when\*(Aq fails \& maxlength Text fields. Validated. \& minlength Text fields. Used in validation \& range_start Range start for number fields \& range_end Range end for number fields .Ve .SS "Field attributes for \s-1DB\s0" .IX Subsection "Field attributes for DB" .Vb 4 \& accessor Database accessor name if different than field name \& unique Field should be unique in the database \& noupdate Don\*(Aqt update this field in the database \& writeonly Do not retrieve initial values \& \& Also see the select field _columns attributes .Ve .SS "Field rendering" .IX Subsection "Field rendering" .Vb 10 \& widget Determines which rendering widget to use for the field \& widget_wrapper Which wrapper widget to apply to the field \& element_attr Hashref to store arbitrary html attributes. \& label_attr Hashref for html attributes for the label \& wrapper_attr Hashref for html attributes for the wrapping element (div, etc) \& element_class Arrayref for classes for the form element \& wrapper_class Arrayref for classes for the form element wrapper \& label_class Arrayref for classes for the form element label \& label Text label for this field. Defaults to ucfirst field name. \& build_label_method provide a builder for \*(Aqlabel\*(Aq attribute \& wrap_label_method provide a coderef to wrap the label \& id Useful for javascript (default is html_name. to prefix with \& form name, use \*(Aqhtml_prefix\*(Aq in your form) \& build_id_method Provide a builder for \*(Aqid\*(Aq attribute \& do_wrapper Flag to render wrapper \& do_label Flag to render label \& size Text & select fields. \& \& render Widget method to render the field ($field\->render) \& renderx "" plus set attributes ($field\->render( element_class => \*(Aq...\*(Aq )) \& render_element Widget method to render unwrapped field ($field\->render_element) \& render_elementx "" plus set attributes ($field\->render_elementx( element_class => \*(Aq...\*(Aq)) .Ve .SS "Field attributes managed by FormHandler" .IX Subsection "Field attributes managed by FormHandler" These attributes are usually accessed in a subroutine or in a template, but are usually set only by FormHandler. ('value' may be changed as a transform _in a validation routine_.) .PP .Vb 4 \& init_value Initial value from the database \& value The value of your field. \& input Input value from parameter or initial value from database \& fif Retrieve (do not set) values for filling in a form .Ve .SH "AUTHOR" .IX Header "AUTHOR" FormHandler Contributors \- see HTML::FormHandler .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" This software is copyright (c) 2017 by Gerda Shank. .PP This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.