1$(document).ready(function () { 2 $("#ctl00_QsPH_contactForm_txt_mail, #ctl00_QsPH_contactForm_txt_opmerkingen").focusout(function (field) { 3 checkFields(field); 4 }); 5}); 6 7function checkFields(field) { 8 let selector = $(field.target), 9 filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/, 10 selectorId = selector.attr("id"), 11 errorTxt = ""; 12 13 if (selectorId != "ctl00_QsPH_contactForm_txt_mail" && selectorId != "ctl00_QsPH_contactForm_txt_opmerkingen") { 14 return; 15 } 16 17 if (selectorId == "ctl00_QsPH_contactForm_txt_mail") { 18 if (selector.val() == "") { 19 errorTxt = "Het veld 'E-mail' is niet ingevuld. Dit is een verplicht veld"; 20 } else if (!filter.test(selector.val())) { 21 errorTxt = "Vul een geldig emailadres in, bijvoorbeeld [email protected]"; 22 } 23 } 24 25 if (selector.val() == "" && selectorId == "ctl00_QsPH_contactForm_txt_opmerkingen") { 26 errorTxt = "Het veld 'Opmerkingen' is niet ingevuld. Dit is een verplicht veld"; 27 } 28 29 if (errorTxt) { 30 selector.siblings(".error").html(errorTxt).attr("role", "alert"); 31 selector.attr("aria-invalid", "true").attr("aria-describedby", selector.siblings(".error").attr("id")); 32 selector.css("border-color", "#B30000"); 33 } else { 34 selector.siblings(".error").html("").attr("role", ""); 35 selector.removeAttr("aria-invalid").removeAttr("aria-describedby"); 36 selector.css("border-color", ""); 37 } 38} 39 40const ckEditorStyle = { 41 definitions: [ 42 { name: 'Marker', element: 'span', classes: ['marker'] }, 43 { name: 'Styled Image (left)', element: 'img', classes: ['left'] }, 44 { name: 'Styled Image (right)', element: 'img', classes: ['right'] } 45 ] 46}; 47 48function createCkEditor(id) { 49 ClassicEditor 50 .create(document.getElementById(id), { 51 toolbar: 52 { 53 items: 54 ['style', 'bold', 'italic', 'underline', 'numberedlist', 'bulletedlist', 'link'], 55 shouldNotGroupWhenFull: true 56 }, 57 style: ckEditorStyle, 58 link: { 59 decorators: { 60 openInNewTab: { 61 mode: 'manual', 62 label: 'Open in a new tab', 63 attributes: { 64 target: '_blank', 65 rel: 'noopener noreferrer' 66 } 67 } 68 }, 69 allowedProtocols: ['https?', 'mailto', 'tel'] 70 } 71 }) 72 .catch(error => { 73 console.error(error); 74 }); 75}
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.