Revision f89df736
Von Tamino Steinert vor etwa 1 Jahr hinzugefügt
SL/Presenter/Tag.pm | ||
---|---|---|
11 | 11 |
html_tag input_tag hidden_tag javascript man_days_tag name_to_id select_tag |
12 | 12 |
checkbox_tag button_tag submit_tag ajax_submit_tag input_number_tag |
13 | 13 |
stringify_attributes textarea_tag link_tag date_tag |
14 |
div_tag radio_button_tag img_tag multi_level_select_tag); |
|
14 |
div_tag radio_button_tag img_tag multi_level_select_tag input_tag_trim);
|
|
15 | 15 |
our %EXPORT_TAGS = (ALL => \@EXPORT_OK); |
16 | 16 |
|
17 | 17 |
use Carp; |
... | ... | |
87 | 87 |
html_tag('input', undef, %attributes, name => $name, value => $value); |
88 | 88 |
} |
89 | 89 |
|
90 |
sub input_tag_trim { |
|
91 |
my ($name, $value, %attributes) = @_; |
|
92 |
$attributes{'data-validate'} .= ' trimmed_whitespaces'; |
|
93 |
|
|
94 |
_set_id_attribute(\%attributes, $name); |
|
95 |
$::request->layout->add_javascripts('kivi.Validator.js'); |
|
96 |
$::request->presenter->need_reinit_widgets($attributes{id}); |
|
97 |
|
|
98 |
input_tag($name, $value, %attributes); |
|
99 |
} |
|
100 |
|
|
90 | 101 |
sub hidden_tag { |
91 | 102 |
my ($name, $value, %attributes) = @_; |
92 | 103 |
input_tag($name, $value, %attributes, type => 'hidden'); |
... | ... | |
653 | 664 |
C<$value> and with arbitrary HTML attributes from C<%attributes>. The |
654 | 665 |
tag's C<id> defaults to C<name_to_id($name)>. |
655 | 666 |
|
667 |
=item C<input_tag_trim $name, $value, %attributes> |
|
668 |
|
|
669 |
This is a wrapper around C<input_tag> that adds ' trimmed_whitespaces' to |
|
670 |
$attributes{'data-validate'} and loads C<js/kivi.Validator.js>. This will trim |
|
671 |
the whitespaces around the input. |
|
672 |
|
|
656 | 673 |
=item C<submit_tag $name, $value, %attributes> |
657 | 674 |
|
658 | 675 |
Creates a HTML 'input type=submit class=submit' tag named C<$name> with the |
Auch abrufbar als: Unified diff
Presenter: füge 'input_tag_trim' hinzu; entfernt Leerzeichen um Eingabe