line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package HTML::Form::TextInput; |
2
|
|
|
|
|
|
|
|
3
|
11
|
|
|
11
|
|
75
|
use strict; |
|
11
|
|
|
|
|
26
|
|
|
11
|
|
|
|
|
342
|
|
4
|
11
|
|
|
11
|
|
52
|
use parent 'HTML::Form::Input'; |
|
11
|
|
|
|
|
20
|
|
|
11
|
|
|
|
|
71
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = '6.11'; |
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
|
1758
|
my $self = shift; |
17
|
116
|
|
|
|
|
187
|
my $old = $self->{value}; |
18
|
116
|
100
|
|
|
|
240
|
$old = "" unless defined $old; |
19
|
116
|
100
|
|
|
|
234
|
if (@_) { |
20
|
|
|
|
|
|
|
Carp::croak("Input '$self->{name}' is readonly") |
21
|
24
|
100
|
100
|
|
|
550
|
if $self->{strict} && $self->{readonly}; |
22
|
22
|
|
|
|
|
39
|
my $new = shift; |
23
|
22
|
100
|
|
|
|
65
|
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
|
|
|
295
|
&& defined($n) |
|
|
|
66
|
|
|
|
|
|
|
|
100
|
|
|
|
|
27
|
|
|
|
|
|
|
&& defined($new) |
28
|
|
|
|
|
|
|
&& length($new) > $n; |
29
|
21
|
|
|
|
|
51
|
$self->{value} = $new; |
30
|
|
|
|
|
|
|
} |
31
|
113
|
|
|
|
|
315
|
$old; |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
1; |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
__END__ |