Prevent special characters in a TextBox

前端 未结 6 1503
一生所求
一生所求 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 23:22

    You can use the keypress JS event and check to see if the pattern entered matches what you want to filter, You can also use the onblur event to do the samething

提交回复
热议问题