复选框值不在Javascript中..? [英] Checkbox values not coming in the Javascript..?
本文介绍了复选框值不在Javascript中..?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当我通过javascript中的复选框值时,这些值即将到来.但是,
它将抛出错误.
我正在使用ASP类型复选框,并将值传递到javascript中.
查看我的代码
-----------
Hi,
When i pass the check box values in the javascript, the values coming. But,
It will thorow the error.
I am using ASP type Check box and i pass the values into javascript.
See my code
-----------
function Val()
{
var Ctrl;
row = document.forms[0].row.value
col = document.forms[0].col.value
for(i=1;i<=row;i++)
{
for(j=1;j<=col;j++)
{
Ctrl = "Row"+i+"Col"+j
if(document.getElementById(Ctrl).checked ==true)''Microsoft JScript runtime error: Object required
{
document.getElementById(Ctrl).value ="Y"
}
else
{
document.getElementById(Ctrl).value ="N"
}
}
}
<input type="checkbox" name="<%="Row"&row & "Col"&col%>"
错误如下:
------------------
Error is below :
------------------
"Microsoft JScript runtime error: Object required"
以前它工作正常.但是,现在不起作用了.
什么是问题..?
Previously it was working fine. But, now it''s not working.
What is the problem..?
推荐答案
<%-- <script language="javascript" type="text/javascript" >
function checkCheckBoxes()
{
if (document.newmember.CheckBox1.checked == false)
{
alert ('Please Agree Terms & Condition First!');
return false;
}
else
{
return true;
}
}
</script>
为什么不尝试这个
Why dont you try this
document.forms[0].elements[i].checked==true
这篇关于复选框值不在Javascript中..?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文