Podpinał ktoś pod Zend_Form walidację w jquery? (http://docs.jquery.com/Plugins/Validation)
Stworzyłem sobie element:
class Default_JQuery_Form_Element_ValidateText extends ZendX_JQuery_Form_Element_UiWidget { public $helper = "validateText"; }
Do tego helper:
class Default_JQuery_View_Helper_ValidateText extends ZendX_JQuery_View_Helper_UiWidget { { $this->jquery->addJavascriptFile('jquery.validate.min.js'); $this->jquery->addOnLoad($("#' . $attribs['formId'] . '").validate();'); return $this->view->formText($name, $value, $attribs['jValidate']); } }
Do tego formularz:
class Default_Form_Test extends Zend_Form { public function init() { )); } }
Wszystko działa jednak dla bardziej rozbudowanej walidacji 'remote' to już odpada. Dodatkowo chcę to zrobić bez użycia atrybutów w inputach, czyli:
$("#form").validate({ rules: { pole: { remote: { url: .... data: { .... } }, pole2: { minlength: 5, } } }, messages: { ... } });
Ma ktoś pomysł jak to ugryźć?