﻿// JScript File

//takes the form and the names to check in an array
//check if all the textboxes in the array has values, if not no submit
function checkform(form, arrNamesToCheck){	
	var i, strEmptyNames=''
	var blnOk = true
	for(i=0; i < arrNamesToCheck.length;i++)
	{
		
		if(form.elements[arrNamesToCheck[i]].value==""){
		    blnOk=false ;
		    strEmptyNames += ' ' + arrNamesToCheck[i] + '\n';
		}
		
	}
    if(blnOk){
        form.submit();
    }else{
        
        alert("Du måste ange \n" + strEmptyNames);
    }
}