HTML::FormFu::Filter::ForceListValue(3pm)

HTML::FormFu::Filter::ForceListValue3pm

Convert a single value into a 1-item-list

Usage

    element:
      - type: Repeatable
        increment_field_names: 0
        elements:
          - name: foo
            render_processed_value: 1
            filter:
              - ForceListValue

Version

version 2.07

Overview

Causes a single submitted value to be changed to a list containing 1 item.

Solves an uncommon problem with a Repeatable block with increment_field_names disabled, when manually increasing the repeat count after the form was submitted with only a single value for each of the Repeatable's fields.

If these circumstances, when rendered, every repeated field would have the initially-submitted value as its default.

Using this filter, and setting render_processed_value to "true" will ensure that only the first repetition of each field will have the submitted value as its default; all subsequent repetitions will have no default value.

Releases

6 releases since Debian 8 (Jessie); the text changed 3 times.

  1. 8
  2. 9
  3. 10–12
  4. 13

Author

Carl Franks

License

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

Author

Carl Franks <[email protected]>

From libhtml-formfu-perl 2.07000-2 in Debian 13 (Trixie). Parsed by carta from the page's man source.