bem-contrib / bem-forms

Forms building library on BEM methogology
33 stars 18 forks source link

Looks we shouldn't prevent form submit on validation #184

Open qfox opened 8 years ago

qfox commented 8 years ago

This prevention should be placed in ajax modifier, I guess.

https://github.com/bem-contrib/bem-forms/blob/6ea4b060735b017befec473cfd8ac3951b77e316/common.blocks/form/_has-validation/form_has-validation.browser.js#L31

awinogradov commented 8 years ago

It is necessary;( we need validate fields before submit or diff actions. What do you mean in ajax modifier? @zxqfox can you write example?

awinogradov commented 8 years ago

@zxqfox ping

qfox commented 8 years ago

@awinogradov pong ^.^

qfox commented 8 years ago
// in code:
field.validate().then();

// in validate:
return $.ajax('/check').then(res => res.ok === true);