checkFields = function () {var inputs = document.getElementById("user-form-template-6").getElementsByTagName("input");var textareas = document.getElementById("user-form-template-6").getElementsByTagName("textarea");var selects = document.getElementById("user-form-template-6").getElementsByTagName("select");for(var i = 0; i < inputs.length; i++){if(!inputs[i].checkValidity() && !inputs[i].classList.contains("invalid")){inputs[i].classList.add("invalid");if(inputs[i].type === "radio" || inputs[i].type === "checkbox"){if(inputs[i].nextSibling.localName === "label" && !inputs[i].nextSibling.classList.contains("invalid")){inputs[i].nextSibling.classList.add("invalid");}}} else if (inputs[i].checkValidity() && inputs[i].classList.contains("invalid")){inputs[i].classList.remove("invalid");if(inputs[i].type === "radio" || inputs[i].type === "checkbox"){if(inputs[i].nextSibling.localName === "label"){inputs[i].nextSibling.classList.remove("invalid");}}}}for(var j = 0; j < textareas.length; j++){if(!textareas[j].checkValidity() && !textareas[j].classList.contains("invalid")){textareas[j].classList.add("invalid");} else if (textareas[j].checkValidity() && textareas[j].classList.contains("invalid")){textareas[j].classList.remove("invalid");}}for(var k = 0; k < selects.length; k++){if(!selects[k].checkValidity() && !selects[k].classList.contains("invalid")){selects[k].classList.add("invalid");} else if (selects[k].checkValidity() && !selects[k].classList.contains("invalid")){selects[k].classList.remove("invalid");}}};var userFormTemplate = document.getElementById("user-form-template-6");userFormTemplate.addEventListener("submit", function (event) {if(!event.target.checkValidity()){checkFields();}if (!event.target.checkValidity()) {event.preventDefault();}}, false);
getRequiredCheckboxes=function(){for(var a=document.getElementById("user-form-template-6").getElementsByTagName("input"),b=[],c=0;c