-2

i want to ignore all special character but "-" and non-english characters on key press in jquery. Actually this input is used to check domain availability. like;

www.________.com | for and end extensions are already provided for user. they won't enter those parts.

can you help?

4

1 回答 1

0

您应该使用 onChange 事件,因为用户也可以将某些内容粘贴到该字段中。

要检查字符串是否是有效的 url,请使用此模式

var urlPattern = /(http|ftp|https):\/\/[\w-]+(\.[\w-]+)+([\w.,@?^=%&:\/~+#-]*[\w@?^=%&\/~+#-])?/
于 2013-07-28T11:06:58.313 回答