Html5 Issue With (Some) Hidden Fields -> 'novalidate'

I have a complex form in which form elements are shown/hidden depending on the status of another dropdown in the form.

Under certain conditions and apparently only with Chrome, form submission did not always work and the message “An invalid form control with name=‘XXXX’ is not focusable” appeared in the console log.

This has to do with HTML5 form validation and can be avoided by adding ‘novalidate’ as an attribute. So I did the following:


$aform =  $this->beginWidget('CActiveForm', array(

        'id'=>$_formId,

        'htmlOptions'=>array(

                'novalidate'=>'1',

        ),

));

This likely only appears with hidden fields. Personally I updated my generators and several locations in my code to include ‘novalidate’.