您的位置:首页 > 其它

检查复选框或单选框是否有被用户选中

2011-09-30 15:29 190 查看
//该函数用于检查复选框或单选框的内容是否有被用户选中

function isnull_checkbutton(itemname,promptmsg){

var itemx = document.getElementsByName(itemname);

if (itemx != null){

if (itemx.length>0){

for (var i=0;i<itemx.length;i++){

if (itemx[i].checked == true){

return "";

}

}

return "请选择" + promptmsg + "\n";

}

}

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: