Skip to content

Commit

Permalink
Fixes #191Fixed code in examples
Browse files Browse the repository at this point in the history
  • Loading branch information
samdark committed Apr 16, 2018
1 parent 019d7dc commit e98999d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions book/forms-activeform-js.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ Getting Attribute Value
In order to be compatible with third party widgets like (Kartik), the best option to retrieve the actual value of an attribute is:

```javascript
$('#form_id').yiiActiveForm('find', '#attribute').value
$('#form_id').yiiActiveForm('find', 'attribute').value
```

Custom Validation
Expand All @@ -128,7 +128,7 @@ In case you want to change the validation of an attribute in JS based on a new c

```javascript
$('#form_id').on('beforeValidate', function (e) {
$('#form_id').yiiActiveForm('find', '#attribute').validate = function (attribute, value, messages, deferred, $form) {
$('#form_id').yiiActiveForm('find', 'attribute').validate = function (attribute, value, messages, deferred, $form) {
//Custom Validation
}
return true;
Expand Down

0 comments on commit e98999d

Please sign in to comment.