[TELE-799] remove custom error displaying

This commit is contained in:
Nicolas Hislaire 2021-06-14 12:02:17 +02:00
parent 2632b8791c
commit f569ca0cfa
1 changed files with 0 additions and 30 deletions

View File

@ -17,36 +17,6 @@ $(function() {
}
// End of General method to get elements thanks to regex !
// unite all errors to the top of the form
var $error_notice = $('form.quixote > div.errornotice');
var $errors = $('form.quixote div.error:visible');
if ($errors.length && $error_notice.length == 0) {
$error_notice = $('<div class="errornotice"></div>');
$('form.quixote').prepend($error_notice);
}
$errors.each(function() {
var field_label = $(this).parents('.widget').find('.title label').text().replace(/[ :\*]+$/g, '');
var $error_text = $('<p>' + field_label + ' : ' + $(this).text() + '</p>');
$(this).hide();
$error_notice.append($error_text);
});
// End of unite all errors ...
// Errors in profile have same behavior than forms' errors
var $profile_errors = $('div.a2-block ul.errorlist');
var $profile_error_notice = $('div.a2-block > div.errorlist');
if ($profile_errors.length && $profile_error_notice.length == 0) {
$profile_error_notice = $('<div class="errorlist"></div>');
$('div.a2-block').prepend($profile_error_notice);
}
$profile_errors.each(function() {
var field_label = $(this).next().find('label').text().replace(/[ :\*]+$/g, '');
var $error_text = $('<p>' + field_label + ' : ' + $(this).text() + '</p>');
$(this).hide();
$profile_error_notice.append($error_text);
});
var $invisible = $('.invisible');
$invisible.each(function() {
if ($(this).find("textarea").text() == '') {