1、控件:
<input type="text" data-bind="value:EXPERTNAME" onblur="CheckQueryStr(this);" class="z-txt" />
2、代码:
function CheckQueryStr(oField) {
re = /select|update|delete|exec|count|'|、|‘|"|“|”|=|;|>|<|%/i;
$sMsg = "请不要输入非法字符!"
if (re.test(oField.value)) {
alert($sMsg);
oField.value = '';
oField.focus();
return false;
}
}