ZF-7847: Javascript issue with Hidden Element while using Zend Checkbox
Description
While creating the CheckBox element using zend form, it is generating the hidden element which is causing the java script validation problem.
Ex: If you say like "document.form.mycheckbox.checked" the script will fail because in the same name we have a hidden element. It would be better if we have any flag for not generating hidden element. By that way we can avoid JavaScript related issues.
Expecting the solution from your side.
FYI: By now in our library, to overcome that problem we have commented hidden generation part. But it is not the right solution.
Comments
Posted by Nick Routsong (nickrouty) on 2009-10-19T15:42:23.000+0000
This was supposedly fixed in 1.5, but the error continues... please fix!!
Posted by Dolf Schimmel (Freeaqingme) (freak) on 2009-10-19T15:48:13.000+0000
It was fixed with r7646: http://framework.zend.com/code/changelog/… .
Posted by Andrei Iarus (poni1111) on 2010-04-14T07:27:35.000+0000
It seems that in version 1.10.1-1.10.3 the problem still exists. This behavior probably is not W3 compliant.
Posted by Marc Hodgins (mjh_ca) on 2010-11-28T19:01:51.000+0000
The simple workaround here is to set the checkbox 'id' attribute. This allows you to access the checkbox from javascript with document.getElementById() because the hidden element does not get the ID set.