ValidForm Builder

Easy and safe XHTML 1.0 strict forms with validation!

Contents

VF_Area→__construct

VF_Area→__construct — Creates a new VF_Area object


Description

__construct([string $label, [bool $interActive, [string $name, [bool $checked, [array $meta]]]]]);

Creates a new VF_Area object.

Parameters

  • label
    Label of the new area.
  • interActive
    If area is interactive, a checkbox will be shown to enable or disable the entire area.
  • name
    If area is interactive, this is the name (and ID) of the checkbox element
  • checked
    If true, the area's checkbox is checked by default. Default value: false.
  • meta
    Additional meta information revision needed

Return values

A new VF_Area object is returned.

Examples

This class can be used in combination with the addFieldset method but this is not required.

$objForm->addFieldSet("Addresses");
$objHomeAddress = $objForm->addArea("Home address", FALSE, "home_address");
$objHomeAddress->addField("street","Street name", VFORM_STRING");
//*** The meta data and other address fields go here.
$objWorkAddress = $objForm->addArea("Work address", TRUE, "work_address");
$objWorkAddress->addField("street","Street name", VFORM_STRING");
//*** The meta data and other address fields go here.

The sample above will first create a fieldset with the header "Addresses". After that the user will be required to fill in his home address and optional, the user can enable the "Work address" fields.