Yii 1.1.1 ~ Yii 1.1.6 This feature has been integrated since version 1.1.7. See CActiveForm
This extension just extend from {link: CActiveForm} using few codes, it enhances the ajax validation.
Using this extension is same as original CActiveForm.
$form = $this->beginWidget('ext.EActiveForm'); ... // as same as normal CActiveForm codes ... $this->endWidget();
Controller example codes for verifying modified attributes only:
protected function performAjaxValidation($model) { if (Yii::app()->request->isAjaxRequest && isset($_POST['ajax'])) { $class = get_class($model); if (isset($_POST['attributes']) && is_array($_POST['attributes'][$class])) $attributes = $_POST['attributes'][$class]; else $attributes = null; echo CActiveForm::validate($model, $attributes); Yii::app()->end(); } }
Nov 28, 2010
Nov 14, 2010
For CRegualarExpressionValidator, please make sure Javascript compatible.
Reporting Issues and comments are welcome, plz report them to offical extension page of Yii. Report issue
Total 7 comments
Your 1.2.tgz is corrupt, but the .zip file is OK.
As the title, thanks to Qiang.
The extension now only need for the Yii older than version 1.1.7
thanks for your report, I have fixed it. Because I just used validateOnChange, so I haven't found this problem before.
Great extension, a real time saver and takes a load off the server ;-)
One problem though : it will not properly validate radiolist items. This is because it will not look for the value in the 'name' attribute but in 'id', which isn't identical to id for the case of radio lists.
Thanks
I think it will be better to set the default value of public property enableAjaxValidation true, as follow:
This is just great ! Thanks a lot.
I added public function init(){ $this->enableAjaxValidation = true; $this->clientOptions['validateOnSubmit'] = true; } because only reason i change Yii generated code to EActiveForm is js validation and it needs the options.
'CRequiredValidator','CRegularExpressionValidator', 'CEmailValidator','CUrlValidator','CCompareValidator', 'CStringValidator','CRangeValidator','CNumberValidator', 'CBooleanValidator'
Leave a comment
Please login to leave your comment.