]> _ Git - ccv-wordpress.git/commitdiff
wait #7041 @1:30
authorsoufiane <soufiane@cubedesigners.com>
Mon, 14 Oct 2024 17:04:36 +0000 (19:04 +0200)
committersoufiane <soufiane@cubedesigners.com>
Mon, 14 Oct 2024 17:04:36 +0000 (19:04 +0200)
wp-content/themes/CCV/resources/views/partials/content-form.blade.php

index 553ce215bfdf2e07215e1040c619de57d08c1eb6..a8447c98020dffd75963262a4e124827a5fa2be4 100644 (file)
     {{-- IMAGES ONLINE --}}
     <div class="imagery-type-wrapper mb-8">
       <div class="flex mb-8">
-        <input type="radio" id="imagery_web" name="imagery-type" value="{{ __('Images en ligne', 'ccv') }}">
         <label for="imagery_web" class="imagery-icon">@svg('imagery-web', 'w-22 md:w-20 sm:w-16')</label>
         <div class="ml-4">
           <div class="text-lg sm:text-base font-normal leading-tight mb-1">
   </form>
   <script>
     (function ($) {
+      $('.imagery-link-block').each(function(i, el) {
+        $(this).find('input').on("input", function() {
+          if($(this).val() !== '') {
+            $(this).parents('.imagery-link-block').find('input').attr('data-parsley-required', 'true').attr('required');
+          }else {
+            $(this).parents('.imagery-link-block').find('input').removeAttr('data-parsley-required required');
+          }
+        })
+      })
+
       $('[name=social-cover]').on('change', function() {
         var isChecked = $(this).is(':checked');
         if (isChecked) {
         }
 
         // Re-validate the form to apply the changes
-        $('[name=work-accident]').parsley().validate();
+        $('[name=work-accident]').parsley().validate()
       });
 
       // Clicking browse triggers the file form. It opens the dialog to capture images or browse files