-
Notifications
You must be signed in to change notification settings - Fork 19
demonstrate usage inside a form #11
Comments
Just to give a little more background, here is iron-form's validate function: validate: function() {
var valid = true;
// Validate all the custom elements.
var validatable;
for (var el, i = 0; el = this._customElements[i], i < this._customElements.length; i++) {
if (el.required && !el.disabled) {
validatable = /** @type {{validate: (function() : boolean)}} */ (el);
// Some elements may not have correctly defined a validate method.
if (validatable.validate)
valid = !!validatable.validate() && valid;
}
}
// Validate the form's native elements.
for (var el, i = 0; el = this.elements[i], i < this.elements.length; i++) {
// Custom elements that extend a native element will also appear in
// this list, but they've already been validated.
if (!el.hasAttribute('is') && el.willValidate && el.checkValidity && el.name) {
valid = el.checkValidity() && valid;
}
}
return valid;
}, When a |
Making the captcha works with iron-form need some work because it needs to implement IronFormElementBehavior. Anyway i've updated my demo file to show usage in a form with some basic javascript calls. You can' find it here |
Hi @cbalit, thanks so much for taking a look. Indeed, I'm specifically asking about deeper integration with iron-form (via |
@jab I don't think it will be tricky to implement those behaviours. I will be happy to review any PR even if I'm not a crack :). Feel free to ask if you have any questions or remarks. |
Core devs, please see the PR I just submitted for this -- #12 -- and let me know what you think! |
@jab i look at your PR and it looks great.
Good job Cyril |
The demo at http://cbalit.github.io/re-captcha/components/re-captcha/ (click "DEMO" in the upper right) demonstrates different flavors of the captcha (default, dark, and audio), but they're all shown in isolation, i.e. not in the context of a containing form, which is the most common place captchas are needed.
Would you consider adding an example to the demo of a google-recaptcha inside an iron-form, fully integrated into the form's overall validity state? (Bonus points for a paper submit button whose disabled state is bound to the form's validity.)
Figuring out how to adapt a default recaptcha to dark or audio is straightforward to newcomers, but figuring out how to hook it into an iron-form isn't, so it'd be a great improvement to the demo to show this.
Thanks for your consideration and for the great work on Polymer.
The text was updated successfully, but these errors were encountered: