Press n or j to go to the next uncovered block, b, p or k for the previous block.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | function license(form) { const type = form["license-type"].value; form["license"].value = form[`license-${type}`].value; } function initLicenses(inputs) { function licenseTypeChange() { var type = this.value; inputs.forEach((item) => { if (item.id.includes(type)) { item.style.display = "block"; } else { item.style.display = "none"; } }); } var licenseRadio = document.querySelectorAll('[name="license-type"]'); if (licenseRadio) { for (var i = 0; i < licenseRadio.length; i++) { licenseRadio[i].addEventListener("change", licenseTypeChange); } } } export { license, initLicenses }; |