// ====================================================================
//                      FUNZIONI DI VALIDAZIONE FORM
//                  copyright Antares di Sbrana Saverio
// ====================================================================

function checkInserisciUtente(elemento)
{
	if(conSeVuoto(elemento.nome))
	{
		erroreMsg("Attenzione inserire il nome e cognome",elemento.nome)
		return false;
	}
	if(conSeVuoto(elemento.user))
	{
		erroreMsg("Attenzione inserire la Username",elemento.user)
		return false;
	}
	if(conSeVuoto(elemento.pass))
	{
		erroreMsg("Attenzione inserire la Password",elemento.pass)
		return false;
	}
	return true;
}

function checkInserisciContratto(elemento)
{
	if(conSeVuoto(elemento.nContratto))
	{
		erroreMsg("Attenzione inserire il num del contratto",elemento.nContratto)
		return false;
	}
	if(conSeVuoto(elemento.ricercaClienteOk))
	{
		erroreMsg("Attenzione selezionare almeno un cliente",elemento.ricercaClienteOk)
		return false;
	}
	if(conLista(elemento.idAgente))
	{
		erroreMsg("Attenzione selezionare almeno un'agente",elemento.idAgente)
		return false;
	}

	return true;
}

