BasicValidation
Basic input validation - Server side equivalent of HTML5 validation.
- Process upload errors.
- Client side support for minlength and matching element values (using JavaScript).
- Full name:
\Qubus\Form\FormBuilder\BasicValidation
Methods
validateRequired
Validate if the control has a value if it's required.
validateMinMax
Validate if min and max for value.
validateLength
Validate the length of the value.
validatePattern
Validate the value of the control against a regex pattern.
validateMatch
Match value against another control.
validateUpload
Check if there were upload errors.
validateType
Validate if value matches the input type.
validateTypeColor
Validate the value for 'color' input type.
validateTypeNumber
Validate the value for 'number' input type.
validateTypeRange
Validate the value for 'range' input type.
validateTypeDate
Validate the value for 'date' input type.
validateTypeDatetime
Validate the value for 'datetime' input type.
validateTypeDatetimeLocal
Validate the value for 'datetime' input type.
validateTypeTime
Validate the value for 'datetime' input type.
validateTypeMonth
Validate the value for 'month' input type.
validateTypeWeek
Validate the value for 'week' input type.
validateTypeUrl
Validate the value for 'url' input type.
validateTypeEmail
Validate the value for 'email' input type.
getValidationScript
Get JavaScript for custom validation.
getValidationScriptRules
Get the rules to build up the validation script
generateValidationScript
Generate validation script
Parameters:
| Parameter | Type | Description |
|---|---|---|
$rules | array |
getValidationScriptMinlength
Get script to match the minimum length
getValidationScriptMatch
Get script to match other element
parseForScript
Parse a message, inserting values for placeholders for JavaScript.
Parameters:
| Parameter | Type | Description |
|---|---|---|
$message | string |
resolvePlaceholderForScript
Get a value for a placeholder for JavaScript.
Parameters:
| Parameter | Type | Description |
|---|---|---|
$var | string |