Comments (4)
Validation alone can be done by using tv4 (or JSV or such) alone.
I don't know about server-side validation, probably it could be done manually by a hook... @davidlgj?
from angular-schema-form.
Hi @aleclofabbro,
it depends on what you mean by server side validation errors. Do you want to do a regular post and then re render the form with validation messages and errors from the server? Or do you want to do an ajax request back to the server to validate a field? Can you describe your use case a bit more?
All validation is currently done with tv4js which has support for custom format validators, but they are synchronous so you can't do ajax requests within them.
Angular 1.3 has support for asynchrous validators via $asyncValidators so we might be able to support those via a form definition in the future.
from angular-schema-form.
@davidlgj Would it not be preferable to have an integrated sever side validation after the tv4 schema validation has passed?
What I am thinking of is, that you first do the client-side validation. If it passes, you do your ajax call. But then you can have two outcomes. Firstly, the server accepts the call and everything is good. Or the server rejects and gives some sort of an error back. If this error would be an error dictionary with the form fields as keys, it would be nice to be able to display them.
E.g. a registration form. The server will check if the chosen username already exists. If so, registration is not allowed with this name.
from angular-schema-form.
+1. We're trying to use HATEOAS rest api and problem+json for resonding on invalid form. So, how to make it possible to validate fields again regarding new problem-json schema, not initial one. I know that the best way i sto make client's rules closest to the server's, but still some conditions can be processed only on the server (e.g. username is already in use)
from angular-schema-form.
Related Issues (20)
- Conditionals for arrays inside arrays
- Maintenance status of the library
- How to show default value in type select titleMAP
- Conditional required rule HOT 1
- Add-on ngModel builder seems to not work at all HOT 3
- Add-on with ng-model="$$value$$" not binding properly in an array HOT 2
- condition is not supported for IE HOT 7
- Required validation messages
- version(0.8.14) regression in conditional array validation HOT 3
- Schema form for Android HOT 1
- Array type schemas do not render HOT 4
- Dynamic Type's from Model
- Form Update
- Form generation for part of schema HOT 1
- npm angular-schema-form uses 0.8.13 rather than 0.8.14 HOT 1
- Broadcast schemaform.error.* broken
- errors in bootstrap templates
- files endpoint option
- checkbox not styled with bootstrap
- Custom layout for specific property/ies
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from angular-schema-form.