Alix Axel Alix Axel - 1 month ago 6
Javascript Question

Parsley.js - Displaying Errors in a Specified Element

Using Parsley.js, is it possible to specify the element that should hold the error messages? I tried:

$('#myForm').parsley({
errors: {
container: {
$('#errorMessages')
}
}
});


But the error messages are still placed right after my form inputs.

Answer

I've added another data- attribute, data-parsley-errors-container="#element" that could allow you directly in dom to specify where the error messages will have to be displayed.

More info here: http://parsleyjs.org/doc/index.html#ui-for-field

Best

Comments