Originariamente inviato da peppeweb
Cavicchiandrea ancora una cosa,
se io dovessi controllare del campo
Richiesta non solo se è vuoto ma anche la sua dimensione, i caratteri inseriti etc etc come è nello script:
if (Descrizione.length < 5) {
error += ' > Il Campo Descrizione è un campo obbligatorio \n';
submitform = false;
}
if (Descrizione.length > 1000 ) {
error += ' > Il Campo Descrizione può contenere massimo 1000 caratteri \n';
submitform = false;
}
if (Descrizione.length > 0 && Descrizione.match(strIllegalChars)) {
error += ' > Il Campo Descrizione contiene caratteri non consentiti \n';
submitform = false;
}
cosi:
codice:
if(obj.Richiesta.value == "" && obj.Pratica.checked){
error += ' > Il Campo Richiesta deve essere compilato\n';
submitform = false;
}else if (obj.Richiesta.length < 5) {
error += ' > Il Campo Richiesta deve contenere almeno 5 caratteri \n';
submitform = false;
}else if (obj.Richiesta.length > 1000 ) {
error += ' > Il Campo Richiesta può contenere massimo 1000 caratteri \n';
submitform = false;
}else if (obj.Richiesta.length > 0 && obj.Richiesta.match(strIllegalChars)) {
error += ' > Il Campo Richiesta contiene caratteri non consentiti \n';
submitform = false;
}