ho risolto .. grazie alla visualizzazione dell'html ..
il value che mi restituiva la funzione era corretto (un numero perchè il valore dell'option è l'indice della tabella da cui estrae il valore)
codice HTML:
<option value="3">RCA ARD</option>
codice HTML:
<select id="fa3" class="fsel_6" onchange=mappa_rca(this) name='copertura' > <option value=""></option> <option value="2">ARD</option> <option value="11">AZIENDA</option> <option value="10">CASA</option> <option value="12">ENERGIA</option> <option value="14">FIDEJUSSIONE</option> <option value="8">INFORTUNI</option> <option value="9">MALATTIA</option> <option value="1">RCA</option> <option value="3">RCA ARD</option> <option value="4">RESP. CIVILE</option> <option value="13">TUTELA GIUDIZIARIA</option> <option value="15">VIAGGIO</option> <option value="5">VITA CAPITALIZ.</option> <option value="6">VITA CASO MORTE</option> <option value="7">VITA MISTA</option></select>
codice HTML:
<select id="fb1" class="fsel_3" onchange=mappa_rca_veicolo(this) name='tipo_veicolo' > <option value=" "></option> <option value="AUTOVETTURA"> AUTOVETTURA </option> <option value="AUTOTASSAMETRO"> AUTOTASSAMETRO </option> <option value="AUTOBUS"> AUTOBUS </option> <option value="TRASPORTO COSE"> TRASPORTO COSE</option> <option value="CICLOM./MOTOCICLO"> CICLOM./MOTOCICLO </option> <option value="MACCHINA OPERATRICE"> MACCH. OPERATRICE </option> <option value="MACCHINA AGRICOLA"> MACCHINA AGRICOLA </option> <option value="RIMORCHIO"> RIMORCHIO </option><br> <option value="NATANTE PRIVATO"> NATANTE PRIVATO </option> <option value="NATANTE PUBBLICO"> NATANTE PUBBLICO </option> <option value="LIBRO MATRICOLA"> LIBRO MATRICOLA </option></select>
codice:
<script type="text/javascript">
function mappa_rca(copertura)
{
var x = copertura.selectedIndex;
var y = copertura.options[x]
var valore = y.text;
if(valore == 'RCA' || valore == 'RCA ARD')
{
//--> si visualizzano la riga RCA (solo per veicolo 'fb1' diverso da 'RIMORCHIO' e 'LIBRO MATRICOLA')
// <option value="RIMORCHIO"> RIMORCHIO </option>
// <option value="LIBRO MATRICOLA"> LIBRO MATRICOLA </option>
//--> si visualizzano la riga RCA
if(document.getElementById('fb1').value != 'LIBRO MATRICOLA' &&
document.getElementById('fb1').value != 'RIMORCHIO')
{document.getElementsByClassName('auto').item(2).style.display='table-row';}
else
{
//--> si nasconde la riga RCA
document.getElementsByClassName('auto').item(2).style.display='none';
document.getElementById('fb5').value = ''; // -> classe di merito
document.getElementById('fb6').checked=false; // -> bersani
document.getElementById('fb6b').checked=false; // -> bersani
document.getElementById('fb6t').checked=false; // -> traino
document.getElementById('fb6tb').checked=false; // -> traino
document.getElementById('fb10').value = ''; // -> note
}
}
else
{
//--> si nasconde la riga RCA
document.getElementsByClassName('auto').item(2).style.display='none';
document.getElementById('fb5').value = ''; // -> classe di merito
document.getElementById('fb6').checked=false; // -> bersani
document.getElementById('fb6b').checked=false; // -> bersani
document.getElementById('fb6t').checked=false; // -> traino
document.getElementById('fb6tb').checked=false; // -> traino
document.getElementById('fb10').value = ''; // -> note
}
}
</script>
codice:
<script type="text/javascript">
function mappa_rca_veicolo(veicolo)
{
var x = veicolo.selectedIndex;
var y = veicolo.options[x]
var valore = y.text;
if(valore != 'LIBRO MATRICOLA' && valore != 'RIMORCHIO')
{
//--> si visualizzano la riga RCA (solo per copertura 'fa3' 'RCA' e 'RCA ARD')
// <option value="1">RCA</option>
// <option value="3">RCA ARD</option>
//--> si visualizzano la riga RCA
if(document.getElementById('fa3').value == '1' || document.getElementById('fa3').value == '3') // copertura
{document.getElementsByClassName('auto').item(2).style.display='table-row';}
else
{
//--> si nasconde la riga RCA
document.getElementsByClassName('auto').item(2).style.display='none';
document.getElementById('fb5').value = ''; // -> classe di merito
document.getElementById('fb6').checked=false; // -> bersani
document.getElementById('fb6b').checked=false; // -> bersani
document.getElementById('fb6t').checked=false; // -> traino
document.getElementById('fb6tb').checked=false; // -> traino
document.getElementById('fb10').value = ''; // -> note
}
}
else
{
//--> si nasconde la riga RCA
document.getElementsByClassName('auto').item(2).style.display='none';
document.getElementById('fb5').value = ''; // -> classe di merito
document.getElementById('fb6').checked=false; // -> bersani
document.getElementById('fb6b').checked=false; // -> bersani
document.getElementById('fb6t').checked=false; // -> traino
document.getElementById('fb6tb').checked=false; // -> traino
document.getElementById('fb10').value = ''; // -> note
}
}
</script>
Invece non ho capito questa questione ..
"Per gli attributi dei tag HTML è sempre bene racchiudere il loro valore tra virgolette; qui non lo hai fatto:"
Grazie mille