You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
This plugin runs custom validations on custom fileds which are not in Yii model.
Usage
php
<div><?php// the format of id name should be like this modelName-attributeName. eg : model is book, attribute of model is name => book-nameecho Html::label("Label","model-model_attribute_1");?> echo Html::textInput("Model[model_attribute_1]", null, [ "class" => "form-control", "id" => "model-model_attribute_1" ]); ?> <div></div></div>
var$form=$('#form');$form.yiiValidator('add',{model:"model",attribute:"model_attribute_2",rules:[{rule :"required",errorMessage :"should fill"},{rule:function(value){returnvalue>0&&value!=="";},errorMessage:"should more than zero!",}]});
About
This plugin runs custom validations on custom fileds which are not in Yii model.