In most web projects, we do both client-side and server-side form validation.
A major part of form validation is error prompt,
the client-side and server-side form vali开发者_运维知识库dation library probably have implemented this for us,
but the error prompt looks different.
How can I design a consistent error prompt for such a system?
Thanks in advance.
The server-side validation should not be concerning itself with presenting errors to the user. It should simply return messages with details relevant to the hurled exception. The client-side exception handler should intercepted these messages, interpret them if necsseary and display the message to the user.
Well, that's the general principle. If you want specific advice you will need to edit your question to more details regarding your architecture.
精彩评论