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

This was supposedly fixed in 1.5, but the error continues... please fix!!

It seems that in version 1.10.1-1.10.3 the problem still exists. This behavior probably is not W3 compliant.

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.