File Coverage

blib/lib/Rose/HTML/Form/Field/Hidden.pm
Criterion Covered Total %
statement 12 18 66.6
branch 0 6 0.0
condition n/a
subroutine 5 12 41.6
pod 8 10 80.0
total 25 46 54.3


line stmt bran cond sub pod time code
1              
2             use strict;
3 19     19   83325  
  19         44  
  19         601  
4             use base 'Rose::HTML::Form::Field::Input';
5 19     19   88  
  19         34  
  19         7026  
6             our $VERSION = '0.616';
7              
8             __PACKAGE__->delete_valid_html_attrs(qw(disabled ismap usemap alt src tabindex
9             checked maxlength onblur onchange onclick ondblclick onfocus onkeydown
10             onkeypress onkeyup onmousedown onmousemove onmouseout onmouseover onmouseup
11             onselect readonly size title accesskey));
12              
13             __PACKAGE__->add_required_html_attrs('value');
14             __PACKAGE__->required_html_attr_value(type => 'hidden');
15              
16              
17 0 0   0 1 0  
18 0 0   0 1 0 {
19 0 0   0 1 0 my($self) = shift;
20             $self->html_attr(value => $self->output_value);
21       153 1   return $self->SUPER::html_field(@_);
22       0 0   }
23 0     0 1 0  
24 0     0 0 0 {
25 0     0 1 0 my($self) = shift;
26             $self->html_attr(value => $self->output_value);
27             return $self->SUPER::xhtml_field(@_);
28             }
29 87     87 1 943  
30 87         225 1;
31 87         250  
32              
33             =head1 NAME
34              
35             Rose::HTML::Form::Field::Hidden - Object representation of a hidden field in an HTML form.
36 44     44 1 73  
37 44         103 =head1 SYNOPSIS
38 44         139  
39             $field =
40             Rose::HTML::Form::Field::Hidden->new(
41             name => 'code',
42             default => '1234');
43              
44             print $field->html;
45              
46             ...
47              
48             =head1 DESCRIPTION
49              
50             L<Rose::HTML::Form::Field::Hidden> is an object representation of a hidden field in an HTML form.
51              
52             This class inherits from, and follows the conventions of, L<Rose::HTML::Form::Field>. Inherited methods that are not overridden will not be documented a second time here. See the L<Rose::HTML::Form::Field> documentation for more information.
53              
54             =head1 HTML ATTRIBUTES
55              
56             Valid attributes:
57              
58             accept
59             class
60             dir
61             id
62             lang
63             name
64             style
65             type
66             value
67             xml:lang
68              
69             Required attributes (default values in parentheses):
70              
71             type (hidden)
72             value
73              
74             =head1 CONSTRUCTOR
75              
76             =over 4
77              
78             =item B<new PARAMS>
79              
80             Constructs a new L<Rose::HTML::Form::Field::Hidden> object based on PARAMS, where PARAMS are name/value pairs. Any object method is a valid parameter name.
81              
82             =back
83              
84             =head1 OBJECT METHODS
85              
86             =over 4
87              
88             =item B<error>
89              
90             This method is a no-op.
91              
92             =item B<has_error>
93              
94             Returns false.
95              
96             =back
97              
98             =head1 AUTHOR
99              
100             John C. Siracusa (siracusa@gmail.com)
101              
102             =head1 LICENSE
103              
104             Copyright (c) 2010 by John C. Siracusa. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.