1

I have several HTML::FormHandler forms working nicely,
the only issue is the submit button, which does not change its text/label.

Here is (part of) my form, the labels for the other fields all work as expected.

    has_field username => ( type => 'Text', label => 'Username', required => 1);
    has_field name => ( type => 'Text', label => 'Name', required => 1);

    has_field submit => ( type => 'Submit', label => 'Create',do_label => 1, 
element_class => 'button' );

Now the element class is set and works, but the button shows 'save', not 'create'.

According to the docs, labels are not rendered for submit buttons unless
do_label is set, but for me, it makes no difference.

I have also tried giving a build_label method, also to no effect.

I'd be glad for any pointers on how I can achieve this using HTML::FormHandler methods, as I am using these forms quite extensively and would not like to put them in by hand.

bytepusher
  • 1,568
  • 10
  • 19

1 Answers1

3

For submit fields, you need to use value and not label

Try:

has_field submit => ( type => 'Submit', value => 'Create',
    element_class => 'button' );

Source: https://metacpan.org/pod/HTML::FormHandler::Field::Submit

Dre
  • 4,298
  • 30
  • 39
  • Thanks, will accept asap. Somehow I found the do_label in the docs and stopped looking further, guess I should have known it is somewhere out there :/ – bytepusher Feb 17 '15 at 15:53