The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Form::Factory::Control::Checkbox - the checkbox control

VERSION

version 0.001

SYNOPSIS

  has_control yes_no_box => (
      control => 'checkbox',
      options => {
          checked_value   => 'Yes',
          unchecked_value => 'No',
          is_checked      => 1,
      },
  );

DESCRIPTION

This represents a toggle button, typically displayed as a checkbox. This control implements Form::Factory::Control, Form::Factory::Control::Role::Labeled, Form::Factory::Control::Role::ScalarValue.

ATTRIBUTES

checked_value

The string value the control should have when toggled to the checked or on position.

unchecked_value

The string value the control should have when toggled to the unchecked or off position.

is_checked

Whether or not the checkbox is currently toggeld to the checked or on position or not.

stashable_keys

The "is_checked" attribute is stashed.

METHODS

current_value

Returns the "checked_value" if "is_checked" is true. Returns "unchecked_value" otherwise.

AUTHOR

Andrew Sterling Hanenkamp <hanenkamp@cpan.org>

COPYRIGHT AND LICENSE

Copyright 2009 Qubling Software LLC.

This library is free software. You can redistribute it and/or modify it under the same terms as Perl itself.