PROXY  WHOIS  RQUOTE  TEXTS  SOFT  FOREX  BBOARD
 Music  Philosophy  Code  Literature  Russian

= ROOT|Technical|Code_Examples|Perl|site_perl|HTML|Form.pm =

page 9 of 15



sub add_to_form
{
    my($self, $form) = @_;
    push(@{$form->{'inputs'}}, $self);
    $self;
}

sub strict {
    my $self = shift;
    my $old = $self->{strict};
    if (@_) {
	$self->{strict} = shift;
    }
    $old;
}

sub fixup {}


=item $input->type

Returns the type of this input.  The type is one of the following
strings: "text", "password", "hidden", "textarea", "file", "image", "submit",
"radio", "checkbox" or "option".

=cut

sub type
{
    shift->{type};
}

=item $name = $input->name

=item $input->name( $new_name )

This method can be used to get/set the current name of the input.

=item $value = $input->value

=item $input->value( $new_value )

This method can be used to get/set the current value of an
input.

If strict is enabled and the input only can take an enumerated list of values,
then it is an error to try to set it to something else and the method will
croak if you try.

You will also be able to set the value of read-only inputs, but a
warning will be generated if running under C<perl -w>.

=cut

sub name
{
    my $self = shift;
    my $old = $self->{name};
    $self->{name} = shift if @_;
    $old;
}

sub value
{
    my $self = shift;
    my $old = $self->{value};
    $self->{value} = shift if @_;
    $old;
}

=item $input->possible_values

Returns a list of all values that an input can take.  For inputs that
do not have discrete values, this returns an empty list.

=cut

sub possible_values
{
    return;
}

=item $input->other_possible_values

Returns a list of all values not tried yet.

=cut

sub other_possible_values
{
    return;
}

=item $input->value_names

For some inputs the values can have names that are different from the
values themselves.  The number of names returned by this method will
match the number of values reported by $input->possible_values.

When setting values using the value() method it is also possible to
=9=

1|2|3|4|5|6|7|8| < PREV = PAGE 9 = NEXT > |10|11|12|13|14|15

UP TO ROOT | UP TO DIR | TO FIRST PAGE

Google
 


E-mail Facebook Google Digg del.icio.us BlinkList Fark Furl Ma.gnolia Netscape NewsVine Reddit Slashdot Spurl StumbleUpon Technorati YahooMyWeb LiveJournal Blogmarks TwitThis Live News2.ru BobrDobr.ru Memori.ru MoeMesto.ru

0.00767112 wallclock secs ( 0.01 usr + 0.00 sys = 0.01 CPU)