//如果输入关键字给错误提示:正则匹配
点击确定后,表单的内容为空,自动聚焦点
<script type="text/javascript">
function isValid(oField)
{re =/select|update|delete|exec|count|'|"|=|;|>|<|%|#/i;
$sMsg = "请您不要在参数中输入特殊字符和关键字!";
if( re.test(oField.value))
{
alert( $sMsg );
oField.value ='';
oField.focus();
}
}
</script>
<li><label><?php echo Yii::t('campaign', 'campaignName')?>:</label><input type="text" name="campaignName" id="campaignName" value="" οnchange="(isValid(this))" /></li>