The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

HTML::FormFu::Element::_Field - base class for all form-field elements

DESCRIPTION

Base-class for all form-field elements.

METHODS

default

Set the form-field's default value.

default_xml

Arguments: $string

If you don't want the default value to be XML-escaped, use the "default_xml" method instead of "default".

default_loc

Arguments: $localization_key

Set the default value using a L10N key.

value

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.

value_xml

Arguments: $string

If you don't want the value to be XML-escaped, use the "value_xml" method instead of "value".

value_loc

Arguments: $localization_key

Set the value using a L10N key.

non_param

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

label

Set a label to communicate the purpose of the form-field to the user.

label_xml

Arguments: $string

If you don't want the label to be XML-escaped, use the "label_xml" method instead of "label".

label_loc

Arguments: $localization_key

Set the label using a L10N key.

placeholder

Sets the HTML5 attribute placeholder to the specified value.

placeholder_xml

If you don't want the placeholder attribute to be XML-escaped, use the "placeholder_xml" method instead of "placeholder".

Arguments: $string

placeholder_loc

Arguments: $localization_key

Set the placeholder attribute using a L10N key.

comment

Set a comment to be displayed along with the form-field.

comment_xml

Arguments: $string

If you don't want the comment to be XML-escaped, use the "comment_xml" method instead of "comment".

comment_loc

Arguments: $localization_key

Set the comment using a L10N key.

container_tag

Set which tag-name should be used to contain the various field parts (field, label, comment, errors, etc.).

Default Value: 'div'

javascript

Arguments: [$javascript]

If set, the contents will be rendered within a script tag, within the field's container.

retain_default

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.

Default Value: false

force_default

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.

Default Value: false

default_empty_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 Value: false

reverse_single

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.

Default Value: false

reverse_multi

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.

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).

Default Value: false

repeatable_count

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.

clone

See "clone" in HTML::FormFu for details.

deflators

See "deflators" in HTML::FormFu for details.

deflator

See "deflator" in HTML::FormFu for details.

ATTRIBUTES

comment_attributes

Arguments: [%attributes]

Arguments: [\%attributes]

Attributes added to the comment container.

comment_attributes_xml

Arguments: [%attributes]

Arguments: [\%attributes]

If you don't want the values to be XML-escaped, use the "comment_attributes_xml" method instead of "comment_attributes".

add_comment_attributes

add_comment_attrs

See "add_attributes" in HTML::FormFu for details.

add_comment_attributes_xml

add_comment_attrs_xml

See "add_attributes_xml" in HTML::FormFu for details.

add_comment_attributes_loc

add_comment_attrs_loc

See "add_attributes_loc" in HTML::FormFu for details.

del_comment_attributes

del_comment_attrs

See "del_attributes" in HTML::FormFu for details.

del_comment_attributes_xml

del_comment_attrs_xml

See "del_attributes_xml" in HTML::FormFu for details.

del_comment_attributes_loc

del_comment_attrs_loc

See "del_attributes_loc" in HTML::FormFu for details.

container_attributes

Arguments: [%attributes]

Arguments: [\%attributes]

Arguments added to the field's container.

container_attributes_xml

Arguments: [%attributes]

Arguments: [\%attributes]

If you don't want the values to be XML-escaped, use the "container_attributes_xml" method instead of "container_attributes".

add_container_attributes

add_container_attrs

See "add_attributes" in HTML::FormFu for details.

add_container_attributes_xml

add_container_attrs_xml

See "add_attributes_xml" in HTML::FormFu for details.

add_container_attributes_loc

add_container_attrs_loc

See "add_attributes_loc" in HTML::FormFu for details.

del_container_attributes

del_container_attrs

See "del_attributes" in HTML::FormFu for details.

del_container_attributes_xml

del_container_attrs_xml

See "del_attributes_xml" in HTML::FormFu for details.

del_container_attributes_loc

del_container_attrs_loc

See "del_attributes_loc" in HTML::FormFu for details.

label_attributes

Arguments: [%attributes]

Arguments: [\%attributes]

Attributes added to the label container.

label_attributes_xml

Arguments: [%attributes]

Arguments: [\%attributes]

If you don't want the values to be XML-escaped, use the "label_attributes_xml" method instead of "label_attributes".

add_label_attributes

add_label_attrs

See "add_attributes" in HTML::FormFu for details.

add_label_attributes_xml

add_label_attrs_xml

See "add_attributes_xml" in HTML::FormFu for details.

add_label_attributes_loc

add_label_attrs_loc

See "add_attributes_loc" in HTML::FormFu for details.

del_label_attributes

del_label_attrs

See "del_attributes" in HTML::FormFu for details.

del_label_attributes_xml

del_label_attrs_xml

See "del_attributes_xml" in HTML::FormFu for details.

del_label_attributes_loc

del_label_attrs_loc

See "del_attributes_loc" in HTML::FormFu for details.

FORM LOGIC AND VALIDATION

filters

See "filters" in HTML::FormFu for details.

filter

See "filter" in HTML::FormFu for details.

constraints

See "constraints" in HTML::FormFu for details.

constraint

See "constraint" in HTML::FormFu for details.

inflators

See "inflators" in HTML::FormFu for details.

inflator

See "inflator" in HTML::FormFu for details.

validators

See "validators" in HTML::FormFu for details.

validator

See "validator" in HTML::FormFu for details.

transformers

See "transformers" in HTML::FormFu for details.

transformer

See "transformer" in HTML::FormFu for details.

CSS CLASSES

auto_id

See "auto_id" in HTML::FormFu for details.

auto_label

See "auto_label" in HTML::FormFu for details.

auto_error_class

See "auto_error_class" in HTML::FormFu for details.

auto_error_message

See "auto_error_message" in HTML::FormFu for details.

auto_constraint_class

See "auto_constraint_class" in HTML::FormFu for details.

auto_inflator_class

See "auto_inflator_class" in HTML::FormFu for details.

auto_validator_class

See "auto_validator_class" in HTML::FormFu for details.

auto_transformer_class

See "auto_transformer_class" in HTML::FormFu for details.

RENDERING

field_filename

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.

label_filename

The template filename to be used to render the label.

Must be set by more specific field classes.

ERROR HANDLING

get_errors

See "get_errors" in HTML::FormFu for details.

add_error

clear_errors

See "clear_errors" in HTML::FormFu for details.

INTROSPECTION

get_deflators

See "get_deflators" in HTML::FormFu for details.

get_deflator

See "get_deflator" in HTML::FormFu for details.

get_filters

See "get_filters" in HTML::FormFu for details.

get_filter

See "get_filter" in HTML::FormFu for details.

get_constraints

See "get_constraints" in HTML::FormFu for details.

get_constraint

See "get_constraint" in HTML::FormFu for details.

get_inflators

See "get_inflators" in HTML::FormFu for details.

get_inflator

See "get_inflator" in HTML::FormFu for details.

get_validators

See "get_validators" in HTML::FormFu for details.

get_validator

See "get_validator" in HTML::FormFu for details.

get_transformers

See "get_transformers" in HTML::FormFu for details.

get_transformer

See "get_transformer" in HTML::FormFu for details.

get_errors

See "get_errors" in HTML::FormFu for details.

clear_errors

See "clear_errors" in HTML::FormFu for details.

SEE ALSO

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

AUTHOR

Carl Franks, cfranks@cpan.org

LICENSE

This library is free software, you can redistribute it and/or modify it under the same terms as Perl itself.