14 Dec 2018 16:07:11 UTC
- Distribution: HTML-FormFu
- Module version: 2.07
- Source (raw)
- Browse (raw)
- How to Contribute
- Issues (12)
- Testers (577 / 4 / 25)
- KwaliteeBus factor: 2
- 80.07% Coverage
- License: perl_5
- Perl: v5.10.0
- Activity24 month
- Download (334.11KB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest version
- Reverse dependencies
- CPAN Testers List
- Dependency graph
HTML::FormFu::Filter::ForceListValue - convert a single value into a 1-item-list
element: - type: Repeatable increment_field_names: 0 elements: - name: foo render_processed_value: 1 filter: - ForceListValue
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
truewill 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.
This library is free software, you can redistribute it and/or modify it under the same terms as Perl itself.
Carl Franks <email@example.com>
This software is copyright (c) 2018 by Carl Franks.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.