Basic validation of elements against the constraints set in the Editor or programmatically is always performed, regardless of any custom validation.
However, sometimes more complex validation is needed, including validations
that depend on more than one element. This is typically achieved by adding
custom validation logic in an event handler that you set using the input
onCustomValidation() function. Within that
handler, you call the
reject() function to indicate that the element is
invalid. The element's validity is checked when the value of the element
changes either by user interaction or programmatically.
Note that validations other than required, including custom validations, are not run on input elements when they don't have a value.
Mixins provide functionality that other elements can inherit and use.
Mixins are not elements. You cannot add mixins to a page in the Editor like other
$w elements, and mixins are not meant to be used directly
in your code.
For example, you would not write code like this, because it is out of context:
Instead, you can code the following if
myElement is an element that
Was this helpful?