Javascript and only one Checkbox - undefined

后端 未结 8 1283
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-18 11:11
for (i = 0; i < document.checks.user.length; i++) //for all check boxes
{
    if (document.checks.user[i].checked == true )
    {
        document.checks.submit()         


        
8条回答
  •  失恋的感觉
    2021-01-18 11:57

    I too face the same proble with total of 5 checkboxes out of which 4 are disabled and 1 is enabled. Now the checkboxId.length is undefined, so the only option I could think of is if(checkboxId.length ==undefined ){checkboxId.checked=true & submith the form}.

提交回复
热议问题