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

How to mark field as invalid after server validation? #782

Closed
dadmin-admin opened this issue Nov 13, 2015 · 6 comments
Closed

How to mark field as invalid after server validation? #782

dadmin-admin opened this issue Nov 13, 2015 · 6 comments

Comments

@dadmin-admin
Copy link

Hello. Is it possible to add server validation to the form?

Here the description of expected workflow:

  1. User submits the form
  2. Server validates data
  3. On incorrect data server return error messages
  4. Client marks fields as invalid + display error messages per field
  5. On any field value change field is marked as valid and error message is hidden
@fzaninotto
Copy link
Member

That's an enhancement. And the problem is that REST doesn't standardize validation error responses at all. So I guess the answer for that will be #777

@re1naldo
Copy link

After the addition of onSubmitError, is it possible to display error messages below each field? In the example, you used notification.log('...'), which only set an error message for the whole form.

@fzaninotto
Copy link
Member

You'll have to override the default maField template to display these error messages close to the field. We use angular's built-in form validation, which doesn't support this out ouf the box.

@DamasFoux
Copy link

Hello,
Please, I am trying to use the onSubmitError handler but I am getting the following error:
users.creationView(...).onSubmitError is not a function

@re1naldo
Copy link

re1naldo commented Mar 8, 2016

Did you use ng-admin from master branch? #833

@DamasFoux
Copy link

Thanks for helping
No, I have just used it. and the following error appeared

TypeError: t(...) is null ng-admin.min.js (line 15, col 17625)

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

4 participants