开发者

ValidationEngine - Validation is bypassed when spaces are inserted

开发者 https://www.devze.com 2023-03-17 03:29 出处:网络
When only spaces are entered in required field, the validation is bypassed, it assumes that data has 开发者_开发问答been entered in the field, wherein reality it is blank.

When only spaces are entered in required field, the validation is bypassed, it assumes that data has 开发者_开发问答been entered in the field, wherein reality it is blank.

Any suggestions/solutions to this??

Thanks in advance.


jQuery has a nice function for trimming leading and trailing whitespace (API - jQuery Trim)

jQuery.trim(stringToTrim);

Will return the string without the whitespace.

Note that you can accomplish this also with regular expressions.

0

精彩评论

暂无评论...
验证码 换一张
取 消