I have added the checkbox to my sign-up page. but I want that every user should check the button to create an account. I have tried to make it with Javascript. I am using Magento 2.3.0 Here is the code.
<div style="padding-top: 10px;">
<input type="checkbox" required id="checkBoxRequired">
<a href="#">Privacy & Policy</a>
</input>
<span id="span"></span>
</div>
function validateForm() {
var checkbox = document.getElementById("checkBoxRequired");
if (checkbox.checked == false) {
document.getElementById("span").innerHTML = "*Checking the checkbox";
document.getElementById("span").style.color = "red";
document.getElementById("span").style.display = "block";
return false;
}
}
I have added onsubmit="return validateForm()" inside begining form tag!