| 1 | package HTML::Widget::Element::Submit; | ||
| 2 | |||
| 3 | use warnings; | ||
| 4 | use strict; | ||
| 5 | use base 'HTML::Widget::Element::Button'; | ||
| 6 | use NEXT; | ||
| 7 | |||
| 8 | =head1 NAME | ||
| 9 | |||
| 10 | HTML::Widget::Element::Submit - Submit Element | ||
| 11 | |||
| 12 | =head1 SYNOPSIS | ||
| 13 | |||
| 14 | $e = $widget->element( 'Submit', 'foo' ); | ||
| 15 | $e->value('bar'); | ||
| 16 | |||
| 17 | =head1 DESCRIPTION | ||
| 18 | |||
| 19 | Submit button element. | ||
| 20 | |||
| 21 | Inherits all methods from L<HTML::Widget::Element::Button>. | ||
| 22 | |||
| 23 | Automatically sets L<type|HTML::Widget::Element::Button/type> to C<submit>. | ||
| 24 | |||
| 25 | =head1 METHODS | ||
| 26 | |||
| 27 | =head2 new | ||
| 28 | |||
| 29 | =cut | ||
| 30 | |||
| 31 | sub new { | ||
| 32 | return shift->NEXT::new(@_)->type('submit'); | ||
| 33 | } | ||
| 34 | |||
| 35 | =head2 value | ||
| 36 | |||
| 37 | =head2 label | ||
| 38 | |||
| 39 | Sets the form field value. Is also used by the browser as the | ||
| 40 | button label. | ||
| 41 | |||
| 42 | If not set, the browser will usually display the label as "Submit". | ||
| 43 | |||
| 44 | L</label> is an alias for L</value>. | ||
| 45 | |||
| 46 | =head2 retain_default | ||
| 47 | |||
| 48 | If true, overrides the default behaviour, so that after a field is missing | ||
| 49 | from the form submission, the xml output will contain the default value, | ||
| 50 | rather than be empty. | ||
| 51 | |||
| 52 | =head1 SEE ALSO | ||
| 53 | |||
| 54 | L<HTML::Widget::Element> | ||
| 55 | |||
| 56 | =head1 AUTHOR | ||
| 57 | |||
| 58 | Sebastian Riedel, C<sri@oook.de> | ||
| 59 | |||
| 60 | =head1 LICENSE | ||
| 61 | |||
| 62 | This library is free software, you can redistribute it and/or modify it under | ||
| 63 | the same terms as Perl itself. | ||
| 64 | |||
| 65 | =cut | ||
| 66 | |||
| 67 | 1; |