js菜鸟提问,关于检查字段是否为空 function aa(strName){ if(strName=="") { alert("名字不能为空!"); return false; //试一试 }} 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <script>function CheckForm(){ for(iIndex=0;iIndex<document.forms[0].elements.length;iIndex++) { if(document.forms[0].item(iIndex).tagName=="INPUT") { if(document.forms[0].item(iIndex).type=="text") { if(document.forms[0].item(iIndex).value=="") { return false; } } } } return true;}</script><form><input type=text id="T1" value=""><input type=text id="T2" value=""><input type=text id="T3" value=""><br><input type=button id="B1" value="效验" onclick="if(!CheckForm()){window.confirm('存在NULL')}"></form> <input type=button value=submit onclick="return bb()" id=btSubmit name=btSubmit runat=server>function aa(strName){ if(strName=="") { alert("名字不能为空!"); return false; //试一试 } form1.submit();} <script>function aa(strName){ if(strName=="") { alert("名字不能为空!"); return false; } else return true;}</script><form name=xxx action=xxxx onsubmit="return aa()"> ~~~~~~~ 还是会的,不过我已有办法解决了,仍然谢谢各位!顺便问一下,Html控件没有visible属性,如何实现类似的功能呢? <input type="button" value="button" style="visibility:hidden"><input type="button" value="button" style="visibility:visible">visibility是有占位. 求大神查看一下这段代码有什么问题? 导航条的判断代码没起作用,大家帮忙看看哈,急 自动输出 javascript如何实现GBK编码 这段JS啥意思,求详解... 关于highchart曲线 后台赋值 介释一下 如何使弹出窗口中的数据返回父窗口 字符串替换的性能问题 chrome下面使用img.src图片不变化 如何把从数据库中读出的二进制字段值弄到数组中(在线) 嵌套form的问题!高手帮忙!谢谢
function CheckForm()
{
for(iIndex=0;iIndex<document.forms[0].elements.length;iIndex++)
{
if(document.forms[0].item(iIndex).tagName=="INPUT")
{
if(document.forms[0].item(iIndex).type=="text")
{
if(document.forms[0].item(iIndex).value=="")
{
return false;
}
}
}
}
return true;
}
</script>
<form>
<input type=text id="T1" value="">
<input type=text id="T2" value="">
<input type=text id="T3" value="">
<br>
<input type=button id="B1" value="效验" onclick="if(!CheckForm()){window.confirm('存在NULL')}">
</form>
function aa(strName)
{
if(strName=="")
{
alert("名字不能为空!");
return false; //试一试
}
form1.submit();
}
function aa(strName)
{
if(strName=="")
{
alert("名字不能为空!");
return false;
}
else
return true;
}
</script>
<form name=xxx action=xxxx onsubmit="return aa()">
~~~~~~~
<input type="button" value="button" style="visibility:visible">visibility是有占位.