Debian Codegraph @

lib/HTML/FormHandler/Field/Submit.pm

raw
1 package HTML::FormHandler::Field::Submit;
2 # ABSTRACT: submit field
3 $HTML::FormHandler::Field::Submit::VERSION = '0.410002';
4 use Moose;
5 extends 'HTML::FormHandler::Field::NoValue';
6
7
8 has '+value' => ( default => 'Save' );
9 has '+widget' => ( default => 'Submit' );
10 has '+type_attr' => ( default => 'submit' );
11 has '+html5_type_attr' => ( default => 'submit' );
12 sub do_label {0}
13
14 sub _result_from_input {
15 my ( $self, $result, $input, $exists ) = @_;
16 $self->_set_result($result);
17 $result->_set_input($input);
18 $result->_set_field_def($self);
19 return $result;
20 }
21
22 __PACKAGE__->meta->make_immutable;
23 use namespace::autoclean;
24 1;
25
26 __END__
27
28 =pod
29
30 =encoding UTF-8
31
32 =head1 NAME
33
34 HTML::FormHandler::Field::Submit - submit field
35
36 =head1 VERSION
37
38 version 0.410002
39
40 =head1 SYNOPSIS
41
42 Use this field to declare a submit field in your form.
43
44 has_field 'submit' => ( type => 'Submit', value => 'Save' );
45
46 It will be used by L<HTML::FormHandler::Render::Simple> to construct
47 a form with C<< $form->render >>.
48
49 Uses the 'submit' widget.
50
51 If you have multiple submit buttons, currently the only way to test
52 which one has been clicked is with C<< $field->input >>. The 'value'
53 attribute is used for the HTML input field 'value'.
54
55 =head1 AUTHOR
56
57 FormHandler Contributors - see HTML::FormHandler
58
59 =head1 COPYRIGHT AND LICENSE
60
61 This software is copyright (c) 2017 by Gerda Shank.
62
63 This is free software; you can redistribute it and/or modify it under
64 the same terms as the Perl 5 programming language system itself.
65
66 =cut