HTML::FormFu::Element::_Field - base class for all form-field elements
Base-class for all form-field elements.
Set the form-field's default value.
Arguments: $string
If you don't want the default value to be XML-escaped, use the "default_xml" method instead of "default".
Arguments: $localization_key
Set the default value using a L10N key.
For most fields, "value" is an alias for "default".
For the HTML::FormFu::Element::Checkbox and HTML::FormFu::Element::Radio elements, "value" sets what the value of the field will be if it is checked or selected. If the "default" is the same as the "value", then the field will be checked or selected when rendered.
For the HTML::FormFu::Element::Radiogroup and HTML::FormFu::Element::Select elements, the "value" is ignored: values or options provides the equivalent function.
If you don't want the value to be XML-escaped, use the "value_xml" method instead of "value".
Set the value using a L10N key.
Arguments: bool
If true, values for this field are never returned by "params" in HTML::FormFu, "param" in HTML::FormFu and "valid" in HTML::FormFu.
This is useful for Submit buttons, when you only use its value as an indicator.
Default Value: false
Set a label to communicate the purpose of the form-field to the user.
If you don't want the label to be XML-escaped, use the "label_xml" method instead of "label".
Set the label using a L10N key.
Sets the HTML5 attribute placeholder to the specified value.
placeholder
If you don't want the placeholder attribute to be XML-escaped, use the "placeholder_xml" method instead of "placeholder".
Set the placeholder attribute using a L10N key.
Set a comment to be displayed along with the form-field.
If you don't want the comment to be XML-escaped, use the "comment_xml" method instead of "comment".
Set the comment using a L10N key.
Set which tag-name should be used to contain the various field parts (field, label, comment, errors, etc.).
Default Value: 'div'
Arguments: [$javascript]
If set, the contents will be rendered within a script tag, within the field's container.
script
If "retain_default" is true and the form was submitted, but the field didn't have a value submitted, then when the form is redisplayed to the user the field will have its value set to its default value, rather than the usual behaviour of having an empty value.
false
If "force_default" is true and the form was submitted, and the field has a default/value set, then when the form is redisplayed to the user the field will have its value set to its default value.
If the default value is being changed after FormFu->process is being called the later default value is respected for rendering, *but* nevertheless the input value doesn't respect that, it will remain the first value.
Designed for use by Checkbox fields. Normally if a checkbox is not checked, no value is submitted for that field. If default_empty_value is true, the Checkbox field is given an empty value during process. Please note that, with this setting, the checkbox gets an EMPTY value (as opposed to no value at all without enabling it), NOT the default value assigned to the element (if any).
default_empty_value
If true, then the field's label should be rendered to the right of the field control. (When the field is used within a Multi block, the position of the label is controlled by the "reverse_multi" option instead.)
The default value is false, causing the label to be rendered to the left of the field control (or to be explicit: the markup for the label comes before the field control in the source).
Exception: If the label tag is 'legend', then the reverse_single attribute is ignored; the legend always appears as the first tag within the container tag.
If true, then when the field is used within a Multi block, the field's label should be rendered to the right of the field control.
Only available for fields attached to a Repeatable element, after $repeatable->repeat($count) has been called.
The value is inherited from "repeatable_count" in HTML::FormFu::Element::Repeatable.
See "clone" in HTML::FormFu for details.
See "deflators" in HTML::FormFu for details.
See "deflator" in HTML::FormFu for details.
Arguments: [%attributes]
Arguments: [\%attributes]
Attributes added to the comment container.
If you don't want the values to be XML-escaped, use the "comment_attributes_xml" method instead of "comment_attributes".
See "add_attributes" in HTML::FormFu for details.
See "add_attributes_xml" in HTML::FormFu for details.
See "add_attributes_loc" in HTML::FormFu for details.
See "del_attributes" in HTML::FormFu for details.
See "del_attributes_xml" in HTML::FormFu for details.
See "del_attributes_loc" in HTML::FormFu for details.
Arguments added to the field's container.
If you don't want the values to be XML-escaped, use the "container_attributes_xml" method instead of "container_attributes".
Attributes added to the label container.
If you don't want the values to be XML-escaped, use the "label_attributes_xml" method instead of "label_attributes".
See "filters" in HTML::FormFu for details.
See "filter" in HTML::FormFu for details.
See "constraints" in HTML::FormFu for details.
See "constraint" in HTML::FormFu for details.
See "inflators" in HTML::FormFu for details.
See "inflator" in HTML::FormFu for details.
See "validators" in HTML::FormFu for details.
See "validator" in HTML::FormFu for details.
See "transformers" in HTML::FormFu for details.
See "transformer" in HTML::FormFu for details.
See "auto_id" in HTML::FormFu for details.
See "auto_label" in HTML::FormFu for details.
See "auto_error_class" in HTML::FormFu for details.
See "auto_error_message" in HTML::FormFu for details.
See "auto_constraint_class" in HTML::FormFu for details.
See "auto_inflator_class" in HTML::FormFu for details.
See "auto_validator_class" in HTML::FormFu for details.
See "auto_transformer_class" in HTML::FormFu for details.
The template filename to be used for just the form field - not including the display of any container, label, errors, etc.
Must be set by more specific field classes.
The template filename to be used to render the label.
See "get_errors" in HTML::FormFu for details.
See "clear_errors" in HTML::FormFu for details.
See "get_deflators" in HTML::FormFu for details.
See "get_deflator" in HTML::FormFu for details.
See "get_filters" in HTML::FormFu for details.
See "get_filter" in HTML::FormFu for details.
See "get_constraints" in HTML::FormFu for details.
See "get_constraint" in HTML::FormFu for details.
See "get_inflators" in HTML::FormFu for details.
See "get_inflator" in HTML::FormFu for details.
See "get_validators" in HTML::FormFu for details.
See "get_validator" in HTML::FormFu for details.
See "get_transformers" in HTML::FormFu for details.
See "get_transformer" in HTML::FormFu for details.
Base-class for HTML::FormFu::Element::_Group, HTML::FormFu::Element::_Input, HTML::FormFu::Element::Multi, HTML::FormFu::Element::ContentButton, HTML::FormFu::Element::Textarea.
Is a sub-class of, and inherits methods from HTML::FormFu::Element
HTML::FormFu
Carl Franks, cfranks@cpan.org
cfranks@cpan.org
This library is free software, you can redistribute it and/or modify it under the same terms as Perl itself.
To install HTML::FormFu, copy and paste the appropriate command in to your terminal.
cpanm
cpanm HTML::FormFu
CPAN shell
perl -MCPAN -e shell install HTML::FormFu
For more information on module installation, please visit the detailed CPAN module installation guide.