Server-side validation for form

前端 未结 4 435
北荒
北荒 2021-02-01 09:05

The default validation for the form I have works as expected. But when a user types in a valid email address and a password of three characters minimum, that doesn\'t mean the l

4条回答
  •  猫巷女王i
    2021-02-01 09:35

    Client-side validation is quick, but it is easy to break, using for example - firebug. You can stick with only server-side validation. Validate everything on server and return BODY with list of keys and error messages. Angular allows you to send data to server asynchronously, end user will see it as client-side validation, as there was no visible post-back.

    See this example, try to click 'Save', and see error messages: upida.cloudapp.net:8080/org.upida.example.angular/order/create?clientId=1

    You can download it: upida.codeplex.com

提交回复
热议问题