From 38695482c067dd8851c9db5b6374107d1c8a0d10 Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Thu, 18 Mar 2021 10:35:41 +0100 Subject: [PATCH] Validate custom text --- pandora_console/include/functions_html.php | 28 +++++++++++++++------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/pandora_console/include/functions_html.php b/pandora_console/include/functions_html.php index c2ec13be47..ae83820bd6 100644 --- a/pandora_console/include/functions_html.php +++ b/pandora_console/include/functions_html.php @@ -577,7 +577,7 @@ function html_print_select_groups( ); if ($required !== false) { - $require_message = __('Please select an item from this list.'); + $require_message = __('Please select an item from this list. Madafaka'); } if (empty($size) === true) { @@ -599,13 +599,6 @@ function html_print_select_groups( $(document).ready(function() { $('select[name=""]').each( function() { - - this.setCustomValidity(''); - $(this).select2({ multiple: , placeholder: "", @@ -640,6 +633,25 @@ function html_print_select_groups( } } }); + + + $(this).on('change', function(e) { + e.currentTarget.setCustomValidity(''); + }) + + $(this).on('invalid', function(e) { + if ($(e.currentTarget).val() == null) { + e.currentTarget.setCustomValidity( + '' + ); + } + }) + + } );