Validate checkbox in a modal mandatory to access the website

0

I have a web page, that upon entering shows a modal that requires validating a mandatory checkbox in order to access the site, how could I do it so that I only leave the modal and enter the site when all the checkboxes are validated?

    
asked by alec_ 05.09.2018 в 17:25
source

1 answer

0

You can use JQuery to validate

var cnt=$("input").length;
var checados=$("input:checked").length;
if(cnt<checados){
    alert("Incompletos");
}
    
answered by 05.09.2018 в 17:27