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

ActiveForm validation error when schema doesn't validate #3

Open
drsdre opened this issue Jan 16, 2016 · 1 comment
Open

ActiveForm validation error when schema doesn't validate #3

drsdre opened this issue Jan 16, 2016 · 1 comment

Comments

@drsdre
Copy link
Contributor

drsdre commented Jan 16, 2016

Although the Json editor widget has build in validation, ActiveForm does not know about invalid data and let's the user save the form. I see two approaches:

  1. This widget adds a client side validation to the ActiveForm in which it operates.
  2. A yii2-json-editor validation rule can be added in the model rules definition which takes care of the client(+server) validation of the data with the schema.

Option 1 is probably the easiest to build and follows the logic of self contained validation. Option 2 is the most transparant from a developers perspective.

Andre

@beowulfenator
Copy link
Owner

I don't think I can add server validation easily. As for client-size validation, let me think this over. Thanks for the idea!

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

2 participants