.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "CGI::Test::Form::Widget::Input 3pm" .TH CGI::Test::Form::Widget::Input 3pm "2022-06-10" "perl v5.34.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" CGI::Test::Form::Widget::Input \- Abstract representation of an input field .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& # Inherits from CGI::Test::Form::Widget .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" This class is the abstract representation of a text input field, i.e. a text field, a password field, a file upload field or a text area. .PP To simulate user input in those fields, there are a set of routines to \&\f(CW\*(C`prepend()\*(C'\fR, \f(CW\*(C`append()\*(C'\fR, \f(CW\*(C`replace()\*(C'\fR, \f(CW\*(C`clear()\*(C'\fR or even run existing text through \f(CW\*(C`filter()\*(C'\fR. .SH "INTERFACE" .IX Header "INTERFACE" The interface is the same as the one described in CGI::Test::Form::Widget, with the following additions: .SS "Attribute Setting" .IX Subsection "Attribute Setting" There are a number of convenience routines that are wrappers on \f(CW\*(C`set_value()\*(C'\fR: .ie n .IP """append"" \fIstring\fR" 4 .el .IP "\f(CWappend\fR \fIstring\fR" 4 .IX Item "append string" Appends the \fIstring\fR text to the existing text. .ie n .IP """clear""" 4 .el .IP "\f(CWclear\fR" 4 .IX Item "clear" Clears existing text. .ie n .IP """filter"" \fIfilter_routine\fR" 4 .el .IP "\f(CWfilter\fR \fIfilter_routine\fR" 4 .IX Item "filter filter_routine" Runs existing text through the given \fIfilter_routine\fR. The \f(CW$_\fR variable is set to the whole text value, and is made available to the filter. Hence you may write: .Sp .Vb 1 \& $input\->filter(sub { s/this/that/g }); .Ve .Sp to replace all instances of \f(CW\*(C`this\*(C'\fR by \f(CW\*(C`that\*(C'\fR within the input text. .ie n .IP """prepend"" \fIstring\fR" 4 .el .IP "\f(CWprepend\fR \fIstring\fR" 4 .IX Item "prepend string" Prepends the \fIstring\fR text to the existing text. .ie n .IP """replace"" \fIstring\fR" 4 .el .IP "\f(CWreplace\fR \fIstring\fR" 4 .IX Item "replace string" Replaces the existing text with \fIstring\fR. .SS "Widget Classification Predicates" .IX Subsection "Widget Classification Predicates" There are additional predicates to distinguish between the various input fields: .ie n .IP """is_area""" 4 .el .IP "\f(CWis_area\fR" 4 .IX Item "is_area" Returns \fItrue\fR for a text area. .ie n .IP """is_field""" 4 .el .IP "\f(CWis_field\fR" 4 .IX Item "is_field" Returns \fItrue\fR for a pure text field. .ie n .IP """is_file""" 4 .el .IP "\f(CWis_file\fR" 4 .IX Item "is_file" Returns \fItrue\fR for a file upload field (text field with browser support for file selection). .ie n .IP """is_password""" 4 .el .IP "\f(CWis_password\fR" 4 .IX Item "is_password" Returns \fItrue\fR for a password field (text field with input masked by \s-1GUI\s0). .SH "AUTHORS" .IX Header "AUTHORS" The original author is Raphael Manfredi. .PP Steven Hilton was long time maintainer of this module. .PP Current maintainer is Alexander Tokarev \fI\fR. .SH "SEE ALSO" .IX Header "SEE ALSO" \&\fBCGI::Test::Form::Widget\fR\|(3), \&\fBCGI::Test::Form::Widget::Input::File\fR\|(3), \&\fBCGI::Test::Form::Widget::Input::Password\fR\|(3), \&\fBCGI::Test::Form::Widget::Input::Text_Area\fR\|(3), \&\fBCGI::Test::Form::Widget::Input::Text_Field\fR\|(3).