我已经放置了一个文本区,并且我想对其进行限制。
只有特殊字符|不允许在文本区输入,因为我在拆分函数中使用了|字符。
发布于 2013-04-24 15:08:21
在文本框中调用此javascript函数
function isSpclChar(){
var iChars = "|";
if(document.qfrm.q.value.indexOf(iChars) != -1) {
alert ("This special character is not allowed.");
return false;}
}
如果您不想在文本框中使用特殊字符
然后使用
var iChars = "!@#$%^&*()+=-[]\\\';,./{}|\":<>?";https://stackoverflow.com/questions/16185356
复制相似问题