1jQuery(document).ready(function ($) { 2 let debounceTimer; 3 let validated = true; 4 5 function allFieldsFilled() { 6 const addressRaw = $('[name="address"]').val().trim(); 7 return addressRaw.length > 0; 8 } 9 10 $(document).on('input change', '[name="address"]', function () { 11 clearTimeout(debounceTimer); 12 const submitBtn = $('[value="Submit"]'); 13 14 debounceTimer = setTimeout(() => { 15 $('[name="wrong-address-error"]').remove(); 16 17 const addressRaw = $('[name="address"]').val().trim(); 18 19 if (allFieldsFilled()) { 20 21 if (addressRaw.includes("@")) { 22 23 submitBtn.prop('disabled', true); 24 25 $('[name="address"]').closest('.nf-field') 26 .append('<div class="nf-error" name="wrong-address-error" style="color:red; margin-bottom:10px;">Please make sure your address does not contain any special characters.</div>'); 27 28 $('[id^="nf-form-"][id$="-cont"]') 29 .append('<div class="nf-error" name="wrong-address-error" style="color:red; margin-bottom:10px;">Please check the address field before submitting.</div>'); 30 31 } else { 32 validated = true; 33 submitBtn.prop('disabled', false); 34 } 35 } 36 37 }, 2000); 38 }); 39 40 41 $(document).on('submit', '[id^="nf-form"]', function (e) { 42 if (!validated) { 43 44 e.preventDefault(); 45 } 46 }); 47});
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.