The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.
[%
    # Form to edit a user

    page.title = 'Edit a User';

    '<p>Simple form for updating a user profile.  This uses macros to generate the HTML form.</p>';


    WRAPPER form_wrapper submit_label = 'Update yourself!';
        PROCESS user_data;
        PROCESS other_data;
        field( 'Write your bio', 'text' );
    END;
%]

[% BLOCK user_data %]
    <fieldset>
        <legend>User Data</legend>


        [%
            field('First name', 'first_name' );
            field('Last name', 'last_name' );

            field('Your US zip code', 'zip', 'Make one up!' );
            field('Your email', 'email' );
            field('Username', 'username' );

            field( 'Password', 'password', 'Change your password' );
            field( 'Retype password', 'password_chk' );

            field('Your age', 'age',
                'This is only for targeted advertising' );

            field('Check to publish your personal info on the Internet', 'share' );



        %]
    </fieldset>
[% END %]

[% BLOCK other_data %]
    <fieldset>
        <legend>Other Data</legend>

        [%
            field('What pets to you have?', 'pets');
            field('What pets to you have?', 'pets2', 'using auto_widget_size');
            field('What pets to you have?', 'pets3', 'explicit "widget"');

            field('Are you married?', 'married' );

            '<p>The type of widget used for Select fields depends on the number
            of options to display:</p>';

            field('Favorite color', 'color', 'Only a few options' );

            field('CSS color', 'css_color', 'A lot of options' );

            field('Other color', 'optional_color', 'This is an optional list' );

            field('Rate yourself', 'rating'  );

            field('Upload /etc/passwd', 'file' );

        %]
    </fieldset>
[% END %]