json-schema-form / angular-schema-form

Generate forms from a JSON schema, with AngularJS!
https://json-schema-form.github.io/angular-schema-form
MIT License
2.47k stars 653 forks source link

OnBlur validation #898

Open alexandroscgb opened 7 years ago

alexandroscgb commented 7 years ago

Hi.

I was wondering if I could validate if the field is empty or not when it looses the focus, showing the validation message, in adition to the submit validation.

I have an onChange function that populate another field and I need to add onBlur validation, is it possible?

Thanks.

alexandroscgb commented 7 years ago

Or I could use onChange property to see if the field is empty and if it is, trigger the same mecanism submit button triggers to show validation messages and css. How could I do something like this? I mean, what is the mecanism to show validation messages and styles?

alexandroscgb commented 7 years ago

I found some similar way, and that is to $scope.$broadcast(fieldId) the field I need to validate, but again, I can't link it to the onBlur event.