Ho scaricato dal sito html sez. jscript il meraviglioso script che avverte se in un form non si immette un campo (precisamente nel mio caso, i campi che iniziano con "req_":
codice:
<!--
function checkrequired(which){
var pass=true
if (document.images){
for (i=0;i<which.length;i++){
var tempobj=which.elements[i]
if (tempobj.name.substring(0,4)=="req_"){
if (((tempobj.type=="text"||tempobj.type=="textarea")&&tempobj.value=='')||(tempobj.type.toString().charAt(0)=="s"&&tempobj.selectedIndex==-1)){
pass=false
break
}
}
}
}
if (!pass){
alert("ATTENZIONE: Mancano alcune informazioni obbligatorie!")
tempobj.focus()
tempobj.select()
return false
}
else
return true
}
//-->
Il mio problema è che questo script controlla solo i campi testo e textarea:
type=="text"||tempobj.type=="textarea"
IO VORREI CONTROLLARE ATTRAVERSO LO SCRIPT ANCHE I CAMPI "SELECT", es: <select name="req_finalita"> ...
grazie in anticipo ai valorosi che si cimenteranno in questo arduo problema.