取消选中单个div中的复选框 [英] uncheck checkboxes within single div
问题描述
我需要在隐藏期间将我的jsp表单的特定部分归零,以取消选中该部分中的复选框。目前,我尝试的任何内容都取消选中表单上的所有复选框或根本不起作用。当我将特定部分与ID相关联时,div中的第一个框未选中但不是第二个框。
建议?
I need to zero in on a specific section of my jsp form during a hide to uncheck the checkboxes in that section. Currently, anything I try either unchecks all checkboxes on the form or doesn''t work at all. When I associated the specific section with ID the first box within the div is unchecked but not the second.
Suggestions?
推荐答案
Heya,Swebster。
为什么这行中有一个eval()?
Heya, Swebster.
Why is there an eval() in this line?
您将需要使用getElementsByTagName()。
You will want to use getElementsByTagName().
eval错误地放置你是对的..
就tagName而言,它是否类似于;因此,通过将标记名标记为div或id并将jsf与所讨论的div一起使用,它将取消选中这些框?
eval was incorrectly placed you''re right..
In terms of tagName, would it be something simlar to; So by marking the tagname to div or id and using the jsf with the div in question it will uncheck those boxes?
通过设置下面函数中的确切菜单,onclick期间复选框对象设置为false并且主要的复选框不受影响。对于每个菜单而言,需要多个菜单才能使用功能,因此必须有更智能的方式。这个部署在IE中,这就是我使用getAttribute的原因。 getAttribute(''class'')==''show''也可以工作,但是将所有可见的菜单选项设置为false,并且有20个。此外,使用通配符''menu *''或''返回错误菜单[1-20]
建议?谢谢
by setting the exact menu in the function below, the checkbox objects are set to false during onclick and the main checkboxes are untouched. With multiple menus to thing of a function would be needed for each one of them so there must be a more intelligent way. This deployment is in IE which is why I am using getAttribute. getAttribute(''class'') == ''show'' works too but sets all the visible menu options to false and there are 20. Also, an error is returned with using a wildcard ''menu*'' or ''menu[1-20]
Suggestions? Thanks
这篇关于取消选中单个div中的复选框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!