Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validation Message On Blur #406

Closed
goodSenor opened this issue May 27, 2015 · 1 comment
Closed

Validation Message On Blur #406

goodSenor opened this issue May 27, 2015 · 1 comment

Comments

@goodSenor
Copy link

Hello,

I was reading through issue #27 and am currently using the validation onBlur feature that you added with ngModelOptions - very nice!

My questions:

  1. Is it possible for validation messages to also show up on blur, rather then when the form is submitted?
  2. Is there a way to style the validation messages that appear?

Thanks!

@goodSenor
Copy link
Author

I figured out what I was trying to to.

  1. Yes - looks like angular validation is happening on blur. The popup "Please enter a {{form.type}}", which is appearing on form submission, is coming from somewhere else. I disabled the button controlling form submission if any form fields were invalid, so the popup wasn't an adequate solution.
  2. Yes - I added the following markup below the tag in default.html in schema-form-decorators (which I think defines the template for a default form field). The styled error message now shows up on blur when you've touched the form field and it's invalid.
<div class="field-caption" ng-if="ngModel.$touched && ngModel.$invalid">
    <span>Please enter a {{form.type}}</span>
</div>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant