I am using parsley.js from http://parsleyjs.org/. Wanted to get the error message from the call back function (onFieldError) and place the value inside a twitter bootstrap popover. In order to do so, I'll need to place it inside the data-content attribute of the popover instead of a div. Can any one tell me how to do this or fix this.
onFieldError: function ( elem, constraints, ParsleyField ) {}
These are the only parameters that are available.
If you look in parsley.js source file, you'll see that there is an
errors
object config at the bottom of the file that allows you to have control over where you want to put your error messages. Let take a look at it:errors.classHander
is the dom element that would receiveparsley-success
andparsley-error
classes.errors.container
is the dom element where would be appended the error element -> basically, it should be here your popover dom elementerrors.errorsWrapper
anderrors.errorElem
would allow you to customize deeper the error template (by default, ul and lis)Hope that would help you
Best