Even when an element of Zend Framework has no setRequired() or has setRequired(false) called it is always rendered as <input ..... required=""
>
And seeing this code Chrome, Firefox and other newest versions of browsers while trying to validate the form before posting it, show the error message that the field is required (although it is not). It seems the browser detects the presence of the attribute required and does not care about its value (empty in this case).
Additionally, I tried <form novalidate="novalidate" ...
> to ignore the browser validation but it did not work (anyway it would not be a good solution as one might still need to keep that browser side validation).
So, the question is how to make ->setRequired(true) to render required="required" and the lack of ->setRequired() or ->setRequired(false) not to render any attribute?