-
Notifications
You must be signed in to change notification settings - Fork 4
Fields
- TextField - simple text input field
- EmailField - simple email input field
- NumberField - simple number input field
- PasswordField - simple password input field
- TextareaField - larger textarea field
- SelectField - select field (with multiselect option)
- CountrySelectField - country select field (with multiselect option)
- StateSelectField - state select field (with multiselect option) - United States
- ProvinceSelectField - province select field (with multiselect option) - Canada
- CheckboxField - single checkbox
- CheckboxGroup - group (collection) of checkbox elements
- RadioGroup - group (collection) of radio elements
<?php
use Formjack\Field\TextField;
// ...
$form->addField(new TextField($name, $options));
-
$name (string) (required)
Field name -
$options (array) (optional)
Array of field options
Default:array()
-
label (string)
Field label.
Default:'' -
value (string)
Initial field value.
Default:'' -
attributes (array)
Array of'key' => 'value'pairs where key is the field attribute and value is the actual attribute value.
Default:array() -
rules (array)
Array of validation rules
Default:array()
<?php
use Formjack\Field\EmailField;
// ...
$form->addField(new EmailField($name, $options));
-
$name (string) (required)
Field name -
$options (array) (optional)
Array of field options
Default:array()
-
label (string)
Field label.
Default:'' -
value (string)
Initial field value.
Default:'' -
attributes (array)
Array of'key' => 'value'pairs where key is the field attribute and value is the actual attribute value.
Default:array() -
rules (array)
Array of validation rules
Default:array()
<?php
use Formjack\Field\NumberField;
// ...
$form->addField(new NumberField($name, $options));
-
$name (string) (required)
Field name -
$options (array) (optional)
Array of field options
Default:array()
-
label (string)
Field label.
Default:'' -
value (string)
Initial field value.
Default:'' -
attributes (array)
Array of'key' => 'value'pairs where key is the field attribute and value is the actual attribute value.
Default:array() -
rules (array)
Array of validation rules
Default:array()
<?php
use Formjack\Field\PasswordField;
// ...
$form->addField(new PasswordField($name, $options));
-
$name (string) (required)
Field name -
$options (array) (optional)
Array of field options
Default:array()
-
label (string)
Field label.
Default:'' -
value (string)
Initial field value.
Default:'' -
attributes (array)
Array of'key' => 'value'pairs where key is the field attribute and value is the actual attribute value.
Default:array() -
rules (array)
Array of validation rules
Default:array()
<?php
use Formjack\Field\TextareaField;
// ...
$form->addField(new TextareaField($name, $options));
-
$name (string) (required)
Field name -
$options (array) (optional)
Array of field options
Default:array()
-
label (string)
Field label.
Default:'' -
value (string)
Initial field value.
Default:'' -
attributes (array)
Array of'key' => 'value'pairs where key is the field attribute and value is the actual attribute value.
Default:array() -
rules (array)
Array of validation rules
Default:array()
<?php
use Formjack\Field\SelectField;
// ...
$form->addField(new SelectField($name, $options));
-
$name (string) (required)
Field name -
$options (array) (optional)
Array of field options
Default:array()
-
label (string)
Field label.
Default:'' -
choices (string|null)
Array of'key' => 'value'pairs where key represents the value that will be submited while value represents the choice label.
Defaultarray() -
value (array|string|null)
Preselected value. Ifmultiselectis set totrueyou can also specify an array of preselected values.
Default:'' -
empty_value (string|null)
Defines the special empty option value (e.g. "-- Choose"). Ifnull, empty options will not show up. Default:null -
attributes (array)
Array of'key' => 'value'pairs where key is the field attribute and value is the actual attribute value.
Default:array() -
multiselect (bool)
Enable/disable multiselect.
Default:false -
rules (array)
Array of validation rules
Default:array()
<?php
use Formjack\Field\CountrySelectField;
// ...
$form->addField(new CountrySelectField($name, $options));
-
$name (string) (required)
Field name -
$options (array) (optional)
Array of field options
Default:array()
-
label (string)
Field label.
Default:'' -
value (array|string|null)
Preselected value. Ifmultiselectis set totrueyou can also specify an array of preselected values.
Default:'' -
empty_value (string|null)
Defines the special empty option value (e.g. "-- Choose"). Ifnull, empty options will not show up. Default:null -
attributes (array)
Array of'key' => 'value'pairs where key is the field attribute and value is the actual attribute value.
Default:array() -
multiselect (bool)
Enable/disable multiselect.
Default:false -
rules (array)
Array of validation rules
Default:array()
<?php
use Formjack\Field\StateSelectField;
// ...
$form->addField(new StateSelectField($name, $options));
-
$name (string) (required)
Field name -
$options (array) (optional)
Array of field options
Default:array()
-
label (string)
Field label.
Default:'' -
value (array|string|null)
Preselected value. Ifmultiselectis set totrueyou can also specify an array of preselected values.
Default:'' -
empty_value (string|null)
Defines the special empty option value (e.g. "-- Choose"). Ifnull, empty options will not show up. Default:null -
attributes (array)
Array of'key' => 'value'pairs where key is the field attribute and value is the actual attribute value.
Default:array() -
multiselect (bool)
Enable/disable multiselect.
Default:false -
rules (array)
Array of validation rules
Default:array()
<?php
use Formjack\Field\ProvinceSelectField;
// ...
$form->addField(new ProvinceSelectField($name, $options));
-
$name (string) (required)
Field name -
$options (array) (optional)
Array of field options
Default:array()
-
label (string)
Field label.
Default:'' -
value (array|string|null)
Preselected value. Ifmultiselectis set totrueyou can also specify an array of preselected values.
Default:'' -
empty_value (string|null)
Defines the special empty option value (e.g. "-- Choose"). Ifnull, empty options will not show up. Default:null -
attributes (array)
Array of'key' => 'value'pairs where key is the field attribute and value is the actual attribute value.
Default:array() -
multiselect (bool)
Enable/disable multiselect.
Default:false -
rules (array)
Array of validation rules
Default:array()
<?php
use Formjack\Field\CheckboxField;
// ...
$form->addField(new CheckboxField($name, $options));
-
$name (string) (required)
Field name -
$options (array) (optional)
Array of field options
Default:array()
-
label (string)
Field label.
Default:'' -
value (bool)
Initial value.
Default:false -
attributes (array)
Array of'key' => 'value'pairs where key is the field attribute and value is the actual attribute value.
Default:array() -
rules (array)
Array of validation rules
Default:array()
<?php
use Formjack\Field\CheckboxGroup;
// ...
$form->addField(new CheckboxGroup($name, $options));
-
$name (string) (required)
Field name -
$options (array) (optional)
Array of field options
Default:array()
-
label (string)
Field group label.
Default:'' -
choices (array)
Array of'key' => 'value'pairs where key represents the value that will be submited while value represents the choice label.
Defaultarray() -
value (array|string|null)
Preselected value(s).
Default:array() -
attributes (array)
Array of'key' => 'value'pairs where key is the field attribute and value is the actual attribute value.
Default:array() -
rules (array)
Array of validation rules
Default:array()
<?php
use Formjack\Field\RadioGroup;
// ...
$form->addField(new RadioGroup($name, $options));
-
$name (string) (required)
Field name -
$options (array) (optional)
Array of field options
Default:array()
-
label (string)
Field group label.
Default:'' -
choices (array)
Array of'key' => 'value'pairs where key represents the value that will be submited while value represents the choice label.
Defaultarray() -
value (array|string|null)
Preselected value(s).
Default:array() -
attributes (array)
Array of'key' => 'value'pairs where key is the field attribute and value is the actual attribute value.
Default:array() -
rules (array)
Array of validation rules
Default:array()