检测表单[文本框]只能输入中、英文、_,现在需要增加允许空格,请大家帮忙啊.
帮我看看,怎么让下面的代码支持添加空格,谢谢了。
========================================================================
<script>
function clientform_Validator(theForm)
{
var pattern = /^[\w\u0100-\uffff]+$/;
if (!pattern.test(theForm.UID.value))
{
alert("用户名不能为空或包含不允许的字符。");
theForm.UID.focus();
return (false);
}
</script>
<form name="register" method="post" action="" onSubmit="return clientform_Validator(this)">
<input name="UID" type="text" class="pn-text" id="UID">
</form>
========================================================================