js使用正则验证非空,写个例子给我,谢谢 js使用正则验证非空,写个例子给我,谢谢,,是写个例子不要就贴个正则,, 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 function chkData() { var reg = /^[\s]*|[\s]*$/g; document.getElementById("TextBox1").value = document.getElementById("TextBox1").value.replace(reg, ""); if (document.getElementById("TextBox1").value.length == 0) { alert("不能为空!"); document.getElementById("TextBox1").focus(); return false; } } timer失效(解决的话,分全散) 急:历treeview下所有的结点的问题 orm框架的更新问题 我使用了ajax控件,上传到空间后web.config报错,大家帮我看看? 请问,业务逻辑中出现审核流程我该如何来实现它呢? 应用程序中的服务器错误 做到有限的安全,让中继只对特定的IP开放。谢谢。 char和nvarchar的一些小问题 长文本字段在DATALIST中的显示问题 准备跳(散分) 出现问题!求有碰到过相同问题之人解答! 【关于刷新】屏蔽问题
var reg = /^[\s]*|[\s]*$/g;
document.getElementById("TextBox1").value = document.getElementById("TextBox1").value.replace(reg, "");
if (document.getElementById("TextBox1").value.length == 0) {
alert("不能为空!");
document.getElementById("TextBox1").focus();
return false;
}
}