Skip to content

Instantly share code, notes, and snippets.

@zeroeth
Created May 30, 2013 20:22
Show Gist options
  • Select an option

  • Save zeroeth/5680855 to your computer and use it in GitHub Desktop.

Select an option

Save zeroeth/5680855 to your computer and use it in GitHub Desktop.
Parsley.js error div several parents up.
$(document).ready(function() {
$('.parsley-form').parsley({
errors: {
container: function (element, isRadioOrCheckbox) {
var $container = element.parents().children(".parsley-error-container");
if ($container.length === 0) {
$container = $("<div class='parsley-error-container'></div>").insertAfter(element);
}
return $container;
}
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment