Is JavaScript validation bad?

后端 未结 14 1647
栀梦
栀梦 2021-02-01 11:56

It has been long time since we have been validating our forms using JavaScript. I am sure this must be the case with most other developers.

Question:

What if the

14条回答
  •  北恋
    北恋 (楼主)
    2021-02-01 12:46

    You should have multiple layers of validation.

    Validation on the client Side

    This is definitely useful because validation can be done without having to go to the server. Requests get to the server once they are validated - saves some traffic.

    Validation on the server side

    If javascript is disabled then the server should also incorporate a level of protection - validation in order to disallow erroneous requests.

提交回复
热议问题