I am just learning input fields and validation and cannot solve the problem in order to have email sent while the input field is checked. If not, it should show us the information" Accept policy".
function validateContact() {
var valid = true;
if (!$("#check").val().checked === true) {
$("#check").css("border", "solid 1px #ff5d5d");
$("#check-info").html("Accept Policy");
valid = false;
}
else {
$("#check").css("border", "none");
$("#check-info").html("");
}
return valid;
}
<span id="check-info"></span>
<h5><input class="t-contact-form__field u-mt-2" name="check" type="checkbox" id="check"
required>I know the policy and accept.</h5>