mardi 7 novembre 2017

How to give alert with Javascript if there are more than 4 answers given in multiple checkbox?

How to give alert with Javascript if there are more than 4 answers given in multiple checkbox question? I have written the following code how ever it doesnt work.

2- Question is it possible to disable the rest checkbox dynamically n this case there is no need to show pop up alert.

var select1 = select = document.getElementById('edit-checkbox');

select1.onchange = function() {
if ($('#edit-checkbox').length > 4) {
 alert("Please dont choose more than 4 answers for this question!");
}




Aucun commentaire:

Enregistrer un commentaire