Check for the content of input in UI

来源:互联网 发布:nginx 判断参数不为空 编辑:程序博客网 时间:2024/04/27 21:23

I think for any UI input field, we should do the following check:

1. whether empty string is allowed2. whether duplicate value is allowed3. whether special character is allowed, like: @, #, $, & etc.

So base on those requirements,  here is something for UI

1. input value should be trimmed2. use some method like 'escape' to escape those speical characters3. it’s better to have some 'AJAX' check whether the value (always the name) is already existed 

原创粉丝点击