Browse Source

form hasManyTable 条目删除后仍然验证required问题

Joker 4 years ago
parent
commit
d590c52dc2
1 changed files with 1 additions and 0 deletions
  1. 1 0
      resources/views/form/hasmanytable.blade.php

+ 1 - 0
resources/views/form/hasmanytable.blade.php

@@ -99,6 +99,7 @@
 
 
     $(container).on('click', '.remove', function () {
     $(container).on('click', '.remove', function () {
         $(this).closest('.has-many-{{ $columnClass }}-form').hide();
         $(this).closest('.has-many-{{ $columnClass }}-form').hide();
+        $(this).closest('.has-many-{{ $columnClass }}-form').find('[required]').prop('required', false);
         $(this).closest('.has-many-{{ $columnClass }}-form').find('.{{ Dcat\Admin\Form\NestedForm::REMOVE_FLAG_CLASS }}').val(1);
         $(this).closest('.has-many-{{ $columnClass }}-form').find('.{{ Dcat\Admin\Form\NestedForm::REMOVE_FLAG_CLASS }}').val(1);
     });
     });
 </script>
 </script>