请问JavaScript 非空验证表单常用代码
优势: 兼容所有浏览器
<script language="javascript" type="text/javascript">
function CheckForm()
{
if(document.getElementById("co2").value==""){
//这里写你要提示的操作
alert("Name cannot be empty");
return false;
}
if(document.getElementById("tel").value==""){
alert("Tel cannot be empty");
return false;
}
return true;
}
</script>
更新时间:2025-04-10 22:29:56
下一篇:请问Typecho页面浏览次数统计插件已修正适配Typecho 1.2
转载请注明原文链接:https://www.muzicopy.com/suibi/96.html
