// JavaScript Document

// attenzione quando usate questo script dovete inserire nel tag form:

// onSubmit="return checkrequired(this)"
// i campi che si vogliono obbligatori devono contenere un id con la parola "richiesto + il nome del campo
// come si vuole che appaia sul pop up di validazione" esempio:
// <input type="text" id="richiestonome" name="nome">

		<!-- Begin
		function checkrequired(which) {
		var pass=true;
		for (i=0;i<which.length;i++) 
		{
		var tempobj=which.elements[i];
		if (tempobj.id.substring(0,9)=="richiesto") 
		{
		if (((tempobj.type=="text"||tempobj.type=="textarea")&& tempobj.value=='')||(tempobj.type.toString().charAt(0)=="s"&& tempobj.selectedIndex==0)) {
		pass=false;
		break;
			  }
		   }
		}
		if (!pass) {
		shortFieldName=tempobj.id.substring(9,30).toUpperCase();
		alert("Per cortesia accertati che il campo "+shortFieldName+" sia completo.");
		return false;
		}
		else
		return true;
		}
		//  End -->

