Skip to content
This repository was archived by the owner on Dec 19, 2024. It is now read-only.

Commit 3891c02

Browse files
committed
Merge pull request #14 from PolymerElements/fix-docs
add docs for this thing
2 parents ff267b5 + d2d9069 commit 3891c02

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

iron-validatable-behavior.html

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,20 @@
1414
<script>
1515

1616
/**
17-
* Use `Polymer.IronValidatableBehavior` to implement an element that validates user input.
17+
* `Use Polymer.IronValidatableBehavior` to implement an element that validates user input.
18+
* Use the related `Polymer.IronValidatorBehavior` to add custom validation logic to an iron-input.
19+
*
20+
* By default, an `<iron-form>` element validates its fields when the user presses the submit button.
21+
* To validate a form imperatively, call the form's `validate()` method, which in turn will
22+
* call `validate()` on all its children. By using `Polymer.IronValidatableBehavior`, your
23+
* custom element will get a public `validate()`, which
24+
* will return the validity of the element, and a corresponding `invalid` attribute,
25+
* which can be used for styling.
26+
*
27+
* To implement the custom validation logic of your element, you must override
28+
* the protected `_getValidity()` method of this behaviour, rather than `validate()`.
29+
* See [this](https://github.com/PolymerElements/iron-form/blob/master/demo/simple-element.html)
30+
* for an example.
1831
*
1932
* ### Accessibility
2033
*

0 commit comments

Comments
 (0)