用document.listform.pid.length方式来取的话,当只有一条记录的时候结果显示的是pid的value长度要用document.getElementsByName("pid").length方式来取控件数组
解决方案 »
- js获取c#的cookie参数值
- 为什么在后台设置层的位置显示不出来啊?急死人啊!
- 求助!一段比较特殊的跑马灯代码
- 关于javascript中的对象问题
- js中的方法怎么取得struts的bean:write标签的值
- 一个关于javascript通过xsl处理xml,在firefox浏览器里显示的问题。
- 怎样让不显示一个页面的源文件啊?
- 请问那里有js for Mozilla的开发资料?????
- 用JS 写正则表达式 判断输入是否以-PS 结尾的内容
- 请问这个悬停显示界面怎么做的,能给个源码吗????
- 菜鸟问题,来者有分
- 我想使IE最大化(没有地址等),不用OPEN,在本页面上怎么实现了,大侠请进!!!
{
//Select ID
var aid="";
var checkCount = 0;
if(document.getElementsByName("pid").length==1)
{
if (document.listform.pid.checked == true)
{
var ch = document.listform.pid.value;
aid += ch+",";
checkCount ++;
}
}
else
{
for (var i=0;i<document.listform.pid.length;i++)
{
var e = document.listform.pid[i];
if (e.checked == true)
{
var ch = document.listform.pid[i].value;
aid += ch+",";
checkCount ++;
}
}
}
if (checkCount == 0)
{
alert("请选择相关货品资料!"+ checkCount);
return false;
}
else
{
alert(checkCount);
document.listform.hp_id.value = aid;
return true;
}
}