NAME

CGI::Test::Form::Widget::Input - Abstract representation of an input field

SYNOPSIS

# Inherits from CGI::Test::Form::Widget

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.

To simulate user input in those fields, there are a set of routines to prepend(), append(), replace(), clear() or even run existing text through filter().

INTERFACE

The interface is the same as the one described in CGI::Test::Form::Widget, with the following additions:

Attribute Setting

There are a number of convenience routines that are wrappers on set_value():

append string

Appends the string text to the existing text.

clear

Clears existing text.

filter filter_routine

Runs existing text through the given filter_routine. The $_ variable is set to the whole text value, and is made available to the filter. Hence you may write:

$input->filter(sub { s/this/that/g });

to replace all instances of this by that within the input text.

prepend string

Prepends the string text to the existing text.

replace string

Replaces the existing text with string.

Widget Classification Predicates

There are additional predicates to distinguish between the various input fields:

is_area

Returns true for a text area.

is_field

Returns true for a pure text field.

is_file

Returns true for a file upload field (text field with browser support for file selection).

is_password

Returns true for a password field (text field with input masked by GUI).

AUTHOR

Raphael Manfredi <Raphael_Manfredi@pobox.com>

SEE ALSO

CGI::Test::Form::Widget(3), CGI::Test::Form::Widget::Input::File(3), CGI::Test::Form::Widget::Input::Password(3), CGI::Test::Form::Widget::Input::Text_Area(3), CGI::Test::Form::Widget::Input::Text_Field(3).