applyOutline() function
Applies a particular outline with a particular delay to an element depending on validity.
Syntax
applyOutline()applyOutline(stateValues)applyOutline(effectID, stateValues)applyOutline(htmlElement, effectID, stateValues)applyOutline(effectID, htmlElement, stateValues)applyOutline(effectID, stateValues, htmlElement)applyOutline(htmlElement, stateValues, effectID)applyOutline(stateValues, htmlElement, effectID)applyOutline(stateValues, effectID, htmlElement)Parameters
-
htmlElementoptional
An object that implements theHTMLElementinterface.
Default:undefined. -
effectIDoptional
A string identifier of the effect.
Default: A unique string value for each function call. -
stateValuesoptional
An object that specifies values for validity states. The available properties are:-
trueoptional
An object with properties for the validity state equal totrue. The available properties are:-
delayoptional
A number in milliseconds for the effect to be deferred for this validity state.
Default:0. -
valueoptional
The value of theoutlineCSS property to be applied for this validity state.
Default: string'1px solid limegreen'.
-
-
falseoptional
An object with properties for the validity state equal tofalse. The available properties are:-
delayoptional
A number in milliseconds for the effect to be deferred for this validity state.
Default:0. -
valueoptional
The value of theoutlineCSS property to be applied for this validity state.
Default: string'1px solid red'.
-
-
Return value
An Array with two functions:
- A function for cancellation the effect if it is deffered.
- A function for setting the effect.
Both functions accept the following arguments:
validationResult
AValidationResultobject.
Exceptions
See exceptions of the function returned by the createApplyEffect() function.
Description
This function was created with using createApplyEffect().
See the description of applyEffect(), cancelEffect(), setEffect() on the createApplyEffect() function page.
Implementation: apply-outline.js.