PageSourceSearch

https://fisio.fr/wp-content/plugins/woocommerce-one-page-checkout-…/asserts/js/dynamic_placeholder.js?ver=1.0

js fisio.fr collected 2026-10-05 03:22:33 UTC 1,733 bytes, 47 lines download raw bytes

1function cclw_applyDynamicPlaceholdersAndLabels() { 
2  if (typeof cclw_dynamic_fields !== 'undefined') {
3    ['billing', 'shipping'].forEach(function(type) {
4      var fields = cclw_dynamic_fields[type] || {};
5      Object.keys(fields).forEach(function(slug) {
6        var input = document.querySelector('[name="' + type + '_' + slug + '"]');
7        var label = input ? input.closest('.form-row')?.querySelector('label') : null;
8       // console.log(fields);
9        if (!input || !label) return;
10
11        // Update placeholder if exists
12        if (fields[slug].placeholder) {
13          input.placeholder = fields[slug].placeholder;
14        }
15
16        // Determine required status safely
17        var isRequired = fields[slug].required === true || fields[slug].required === 'true';
18
19        // Remove any existing required span
20        var existingRequired = label.querySelector('.required');
21        if (existingRequired) {
22          existingRequired.remove();
23        }
24
25        // Update label text
26        label.innerHTML = fields[slug].label || '';
27
28        // Add required asterisk if needed
29        if (isRequired) {
30          label.innerHTML += ' <span class="required" aria-hidden="true">*</span>';
31          input.setAttribute('required', 'required');
32        } else {
33          input.removeAttribute('required');
34        }
35
36        // Log only if not logged before
37        if (!input.dataset.logged) {
38          console.log(slug, 'Required:', isRequired);
39          input.dataset.logged = 'true';
40        }
41      });
42    });
43  }
44}
45
46document.addEventListener('DOMContentLoaded', cclw_applyDynamicPlaceholdersAndLabels);
47jQuery(document.body).on('updated_checkout updated_wc_div', cclw_applyDynamicPlaceholdersAndLabels);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.