Skip to content

Commit

Permalink
Fix validation for hidden inputs (#2726)
Browse files Browse the repository at this point in the history
  • Loading branch information
maurofmferrao authored Sep 2, 2024
1 parent d66cb3b commit ce03c27
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions ui/src/core/xibo-cms.js
Original file line number Diff line number Diff line change
Expand Up @@ -277,8 +277,9 @@ function XiboInitialise(scope, options) {
$(scope + ' .XiboForm').validate({
submitHandler: XiboFormSubmit,
// Ignore the date picker helpers
ignore: '.datePickerHelper',
errorElement: "span",
// and input groups that are hidden
ignore: '.datePickerHelper, :hidden>*:not(.flatpickr-input)',
errorElement: 'span',
errorPlacement: function(error, element) {
if($(element).hasClass('dateControl')) {
// Places the error label date controller
Expand Down
4 changes: 2 additions & 2 deletions views/notification-page.twig
Original file line number Diff line number Diff line change
Expand Up @@ -211,9 +211,9 @@
// NOTE: The validation plugin does not like binding to multiple forms at once.
dialog.find("#notificationForm").validate({
submitHandler: attachmentFormSubmit,
errorElement: "span",
errorElement: 'span',
// Ignore the date picker helpers
ignore: '.datePickerHelper',
ignore: '.datePickerHelper, :hidden>*:not(.flatpickr-input)',
errorPlacement: function(error, element) {
if($(element).hasClass('dateControl')) {
// Places the error label date controller
Expand Down

0 comments on commit ce03c27

Please sign in to comment.