Skip to content

Instantly share code, notes, and snippets.

@codeimpossible
Created January 3, 2013 16:34
Show Gist options
  • Save codeimpossible/4444759 to your computer and use it in GitHub Desktop.
Save codeimpossible/4444759 to your computer and use it in GitHub Desktop.
I love jquery
// function to mark a field invalid in one of our backbone viewws (uses backbone.validation)
function markFieldInvalid (view, attr, error) {
view.getFieldByName(attr)
.addClass('invalid')
.parents('.control-group:first')
.addClass('error')
.find('.help-inline, .help-block')
.text(error);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment