The following function will check if at least 3 options have been checked in form and prompt if not.
But after prompting it goes to the page where submit button points instead staying in form and if condition is OK, it closes window instead going to where submit button points.
Can somebody fix it, I’m enough lost messing with PHP to start now flirting with javascript…
function Goingout(){
var count=0;
for (var i = 0; i <document.mainform.elements.length; i++){
if (document.mainform.elements[i].type==’radio’){
if (document.mainform.elements[i].checked==true){
count++;
}
}
}
if (count>=3) window.close()
else alert(‘Select at least two options to continue’)