ASP Regular Expression Validator for Multi-line textbox

前端 未结 1 1410
执笔经年
执笔经年 2021-01-05 07:02

I need to validate the length of input of a textbox.

The max length property does not work for Multiline textboxes.

The regular expression I have is:

相关标签:
1条回答
  • 2021-01-05 07:50

    Change .{0,500} to [\s\S]{0,500}. Note that carriage returns won't exactly be ignored; they'll still count toward the 500-character limit.

    Of course, if 500 characters is the size of your database field, that's exactly the behavior you want.

    0 讨论(0)
提交回复
热议问题