thedersen/backbone.validation — Issue #23: Check if a specific attribute is valid
Author: FredericLatour
Created: 2012-02-20 21:38:57+00:00
State: open

Is there any way to check if a specific attribute is valid? I couldn't see any method for this.

**The use case:**
I have some attribute which value depends on two other attributes (the value is retrieved from an ajax call that is passed the value of the two other attributes).
The value is updated "on change".
Obviously, I don't want to make this call and set the value if the "two other attributes" are not valid.
I would preferably not repeat the validation logic into "on change" event.

Basically I would like to do:

```javascript
if ( ! this.model.isValid("attr1") && !this.model.isValid("attr2") ) {
return;
}
... ajaxstuff
```
Thanks