Input

Input implements ValidatableInterface, RowDependancyInterface

Abstract base class for form input elements.

Methods

Inherited from InputAttributesTrait
Inherited from Element
Inherited from BasicAttributesTrait

__construct

Create an HTML form input.

Input::__construct( string $name )

setRow

Method for RowDependancyInterface to automatically set a reference to the parent Row object.

Input::setRow( object $row )

addValidationOption

Add a LiveValidation option to the javascript object (eg: onlyOnSubmit: true, onlyOnBlur: true)

Input::addValidationOption( string $option = '' )

addValidation

Add a LiveValidation setting to this element by type (eg: Validate.Presence)

Input::addValidation( string $type, string $params = '' )

isValidatable

Can this input be validated? Prevent LiveValidation for elements with no ID, and readonly inputs.

Input::isValidatable( ): boolean

Return Value: boolean


hasValidation

An input has validation if it’s validatable and either required or has defined validations.

Input::hasValidation( ): boolean

Return Value: boolean


getValidationAsJSON

Get a stringified json object of the current validations.

Input::getValidationAsJSON( ): string

Return Value: string


getValidationOutput

Gets the HTML output for this form element.

Input::getValidationOutput( ): string

Return Value: string


Last updated : September 15, 2018 b92362d