wvActiveForm is a CActiveForm descendant that validates the input on client with jQuery, using the rules defined at the model, while also supporting custom rules. Besides validation some rules may also filter invalid characters during typing.
Validators:
Rules:
CValidator supported:
Starting with 0.7, now wvActiveForm supports layouts for error messages. Just add a 'layoutName' paramater to the form. There are 2 built-in layouts, 'default' (which is compatible with the default Yii error messages) and 'qtip', based on jQuery.qtip.
protected/extensionsJust replace the CActiveForm class with wvActiveForm, and you should automatically get client validation if you use validators on your model.
See the following code example:
$form = $this->beginWidget('ext.wvactiveform.wvActiveForm', array('id'=>'form')); ... <?php $this->endWidget();
To do manual validation, just add an 'validators' option to the field's htmlOptions:
echo $form->textField($model,'ds_login_adm',array('size'=>20,'maxlength'=>20, 'validators'=>array( 'nowhitespace'=>true )));
To use layouts, add a 'layoutName' parameter:
$form = $this->beginWidget('ext.wvactiveform.wvActiveForm', array('id'=>'form', 'layoutName'=>'default'));
Total 2 comments
Saves a lot of work!
Please, keep working on it... It just do a lot of programming task...!!
Congratulations for your work !!!
Leave a comment
Please login to leave your comment.