I want to alter the positioning of each error message. That is display the error message in the respective <div class="errorBlock"></div>
. By using the documentation's code the the error msg is displayed before the element (input) and not displayed as expected.
Any ideas?
As per documentation:
errors: {
container: function (element, isRadioOrCheckbox) {
var $container = element.parent().find(".parsley-container");
if ($container.length === 0) {
$container = $("<div class='parsley-container'></div>").insertBefore(element);
}
return $container;
}
}
My html code is:
INPUT
<div class="input-group date date-picker" data-date-format="dd/mm/yyyy" data-date-viewmode="years">
<input class="form-control dataScrap firstInput" type="text" parsley-notblank="true" parsley-required="true" parsley-error-message="You must input a birth date" readonly="readonly"/>
<span class="input-group-btn">
<button class="btn default" type="button"><i class="fa fa-calendar"></i></button>
</span>
<div class="errorBlock"></div>
</div>
CHECKBOX
<div class="checkbox-list">
<label class="checkbox-inline">
<input type="checkbox" parsley-group="checkboxGroup" parsley-mincheck="2"> Checkbox 1
</label>
<label class="checkbox-inline">
<input type="checkbox" parsley-group="checkboxGroup"> Checkbox 2
</label>
<div class="errorBlock"></div>
</div>