Prevent special characters in a TextBox

前端 未结 6 1517
一生所求
一生所求 2020-12-19 22:55

I want to prevent users from entering url\'s (like a href=\"\") in a TextBox.

I want to use a regular expression validator but no idea what to write?

How ca

6条回答
  •  借酒劲吻你
    2020-12-19 22:56

    You might need to consider doing validation (or stripping) on the server in any event, as a malicious user may do a direct HTTP POST and bypass your javascript

提交回复
热议问题