getElement(); if ($form instanceof Zend_Form_SubForm) { return $this; } /** @var $doc Qs_Doc */ $doc = Zend_Registry::get('doc'); $doc->addCriticalStylesheet('css/components/form.css'); $doc->addScript('js/lib/form-submit-lock.js'); if ($form->getAjaxValidation()) { $options = $form->getScriptOptions(); $doc->addScript('js/lib/form.js') ->addScript('js/jquery.scrollTo.js') ->addInitFunction('Qs_Form.init', [$form->getId(), $options]); } else { $doc->addReadyFunction("$('#{$form->getId()}').formSubmitLock"); } return $this; } }