applyAccess() function
Enables and disables an element depending on validity.
Syntax
applyAccess()applyAccess(stateValues)applyAccess(effectID, stateValues)applyAccess(htmlElement, effectID, stateValues)applyAccess(effectID, htmlElement, stateValues)applyAccess(effectID, stateValues, htmlElement)applyAccess(htmlElement, stateValues, effectID)applyAccess(stateValues, htmlElement, effectID)applyAccess(stateValues, effectID, htmlElement)
Parameters
-
htmlElement
optional
An object that implements theHTMLElement
interface.
Default:undefined
. -
effectID
optional
A string identifier of the effect.
Default: A unique string value for each function call. -
stateValues
optional
An object that specifies values for validity states. The available properties are:-
true
optional
An object with properties for the validity state equal totrue
. The available properties are:-
delay
optional
A number in milliseconds for the effect to be deferred for this validity state.
Default:0
. -
value
optional
The value of thedisabled
property to be applied for this validity state.
Default:false
.
-
-
false
optional
An object with properties for the validity state equal tofalse
. The available properties are:-
delay
optional
A number in milliseconds for the effect to be deferred for this validity state.
Default:0
. -
value
optional
The value of thedisabled
property to be applied for this validity state.
Default:true
.
-
-
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
AValidationResult
object.
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-access.js.