| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package HTML::Form::TextInput; |
|
2
|
|
|
|
|
|
|
|
|
3
|
11
|
|
|
11
|
|
77
|
use strict; |
|
|
11
|
|
|
|
|
21
|
|
|
|
11
|
|
|
|
|
455
|
|
|
4
|
11
|
|
|
11
|
|
55
|
use parent 'HTML::Form::Input'; |
|
|
11
|
|
|
|
|
19
|
|
|
|
11
|
|
|
|
|
62
|
|
|
5
|
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = '6.13'; |
|
7
|
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
# ABSTRACT: An HTML form text input element for use with HTML::Form |
|
9
|
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
#input/text |
|
11
|
|
|
|
|
|
|
#input/password |
|
12
|
|
|
|
|
|
|
#input/hidden |
|
13
|
|
|
|
|
|
|
#textarea |
|
14
|
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub value { |
|
16
|
116
|
|
|
116
|
0
|
2701
|
my $self = shift; |
|
17
|
116
|
|
|
|
|
173
|
my $old = $self->{value}; |
|
18
|
116
|
100
|
|
|
|
249
|
$old = "" unless defined $old; |
|
19
|
116
|
100
|
|
|
|
239
|
if (@_) { |
|
20
|
|
|
|
|
|
|
Carp::croak("Input '$self->{name}' is readonly") |
|
21
|
24
|
100
|
100
|
|
|
684
|
if $self->{strict} && $self->{readonly}; |
|
22
|
22
|
|
|
|
|
34
|
my $new = shift; |
|
23
|
22
|
100
|
|
|
|
56
|
my $n = exists $self->{maxlength} ? $self->{maxlength} : undef; |
|
24
|
|
|
|
|
|
|
Carp::croak("Input '$self->{name}' has maxlength '$n'") |
|
25
|
|
|
|
|
|
|
if $self->{strict} |
|
26
|
22
|
100
|
100
|
|
|
361
|
&& defined($n) |
|
|
|
|
66
|
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
27
|
|
|
|
|
|
|
&& defined($new) |
|
28
|
|
|
|
|
|
|
&& length($new) > $n; |
|
29
|
21
|
|
|
|
|
42
|
$self->{value} = $new; |
|
30
|
|
|
|
|
|
|
} |
|
31
|
113
|
|
|
|
|
270
|
$old; |
|
32
|
|
|
|
|
|
|
} |
|
33
|
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
1; |
|
35
|
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
__END__ |