只想text 控件中输入 数字大小写字母或者下划线 函数应该怎样写,
我写了一个校验的函数,现在只是实现空校验的 功能,若想在此基础上再实现只准输入,数字、字母和下划线应该怎样写,若不符合输入要求就弹出 提示筐
function gethtml()
{
document.Form1send.txt.value=content;
if (document.Form1send.txt.value=='')
{
alert('内容不能为空');
return false;
}
else if(document.Form1send.txt_idinput.value=='')
{
alert('id不能为空')
document.Form1send.txt.value=''
return false;
}
else
{
return true;
}
}