How do you avoid duplication of validation on the server and client-side? Is there a web programming platform that generates one from the other, so I don't have to keep the two in sync?
相关问题
- How to account for clock offsets in a distributed
- Why does the lock insure that the underlying monit
- how to query my database and have it be outputted
- Client Java vs (Adobe) Flash for web applications,
- (Java) Why is a HashSet allowed to be used synchro
相关文章
- Java synchronized block vs concurrentHashMap vs Co
- How does the piggybacking of current thread variab
- C pthread synchronize function
- wait for promises in onbeforeunload
- Angular 6 Server Side Errror: Module not found: Er
- Can you select which column to sync with Sync Fram
- Waiting for condition in Java
- call partialRefreshGet from SSJS using view.PostSc
Most forsake client side scripting and just do server side nowadays. You can use ajax when sending the post, so that the response is a bit lighter weight than reloading the whole page.
Server-side validation is required simply because client-side validation can be disabled.
Client-side validation isn't required, but it makes your application more responsive during error handling, as you no longer need to do a form submit to the server and wait for the resulting page to come back.
A well-designed application uses both.
As a side note, Ajax can be used for certain kinds of validation, such as checking for duplicate usernames on a user registration form. However, basic validation, such as checking if a field contains only numbers, should be done without it.