Salve ho un quesito da porvi.
Ho una form in cui ho bisogno dell'obbligo di inserimento di tutti i campi.
Per poterlo validare ho fatto uno script e nel bottone di submit della form, faccio onclick="ValidateForm(this)".
Quando lancio la pagina mi da errore nella insert (cosa che non dovrebbe nemmenno fare, dato questo script), significando che non vede lo script. Cosa sbaglio?
Lo script é questo :

<script Language="JavaScript">
function ValidateForm(f) {
var retVal;
var msg;

retVal = true;
msg = 'Ci sono errori nella form.\nAlcuni campi obbligatori non sono stati inseriti:\n\n';

if(document.f.category.options==1) {
msg += 'Please enter a value for the \'Category:\' field.\n';
retVal = false;
}
if(document.f.title.value=='') {
msg += 'Please enter a value for the \'Last Assigment covered:\' field.\n';
retVal = false;
}
if(document.f.resumetext.value=='') {
msg += 'Please enter a value for the \'Resume Text:\' field.\n';
retVal = false;
}
// Last line of error message
if(document.f.relocate.value!=1 OR document.f.relocate.value!=0) {
msg += 'Please enter a value for the \'Transfer propension:\' field.\n';
retVal = false;
}
if(document.f.employed.value!=1 OR document.f.employed.value!=0) {
msg += 'Please enter a value for the \'Employed Present:\' copy.\n';
retVal = false;
}

if(!retVal) {
alert(msg + '\n\nPlease correct the errors before continuing.');
}
return retVal;
}
</script>