DOKK / manpages / debian 12 / libhtml-formhandler-perl / HTML::FormHandler::Field::AddElement.3pm.en
HTML::FormHandler::Field::AddElement(3pm) User Contributed Perl Documentation HTML::FormHandler::Field::AddElement(3pm)

HTML::FormHandler::Field::AddElement - Field to support repeatable javascript add

version 0.40068

EXAMPLE field for rendering an AddElement field for doing javascript additions of repeatable elements.

You probably want to make your own.

The main requirements are that the button have 1) the 'add_element' class, 2) a 'data-rep-id' attribute that contains the id of the repeatable to which you want to add an element.

HTML::FormHandler::Field::AddElement

    has_field 'add_element' => ( type => 'AddElement', repeatable => 'foo',
        value => 'Add another foo',
    );

Requires the name of a Repeatable sibling field.

The value of the button that's rendered, 'Add Element' by default.

FormHandler Contributors - see HTML::FormHandler

This software is copyright (c) 2017 by Gerda Shank.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

2022-03-25 perl v5.34.0