I am using HTML5 to validate my code but due to Javascript it is not submiting. It is showing the error Invalid form control with name="..." is not focusable for the feilds which are not selected. Since I have use Javascript for dynamic switching. Heres the code
function prodType(value) {
document
.querySelectorAll(".fieldbox")
.forEach((node) => (node.style.display = "none"));
$("input").prop('required',true);
document.getElementById(map[value]).style.display = "block";
}
I have tried the few solutions which were discussed before but it is not working.
function prodType(value) {
document
.querySelectorAll(".fieldbox")
.forEach((node) => (node.style.display = "none"));
$("input").prop('required',true);
document.getElementById(map[value]).style.display = "block";
document.getElementById('id here').removeAttribute = "required";
}
id here for the id for the for which it is showing error