Ciao a Tutti,
ho il seguente problema:
ho la mia pagina web in cui ho definito la funzione add_row e del_row,
che mi consentono di aggiungere / deletare righe di una tabella.
Se schiaccio il pulsante "+" e "-" della serie "act", tutto funziona bene.
Se invece schiaccio il pulsante "+" della serie "act" e poi il "+" della serie "cc_list", ho errore e non va piu' niente. (stessa cosa per la funzione del_row).
<head>
<script type="text/javascript">
var i = 1; var j = 1
function add_row(v) {
if ((v=='i') && !(i==11)) { i++; document.getElementById('act'+i).style.display=''; }
else { i = 10; }
if ((v=='j') && !(j==6)) { j++; document.getElementByI('cc_list'+j).style.display= '';}
else { j = 5; }
}
function del_row(v) {
if ((v=='i') && !(i==1)) { document.getElementById('act'+i).style.display='no ne'; i--;}
if ((v=='j') && !(j==1)) { document.getElementById('cc_list'+j).style.display ='none'; j--;}
}
</script>
</head>
<body>
...
<tr><td><button onClick="add_row('i')">+</button></td>
<td> <button onClick="del_row('i')">-</button></td></tr>
<tr id="act1"><td>text1</td></tr>
<tr id="act2" style="display:none"><td>text2</td></tr>
....
<tr id="act10" style="display:none">"><td>text10</td></tr>
....
....
....
<tr><td><button onClick="add_row('j)">+</button></td>
<td> <button onClick="del_row('j')">-</button></td></tr>
<tr id="cc_list1"><td>text A</td></tr>
<tr id="cc_list2" style="display:none"><td>text B</td></tr>
....
<tr id="cc_list5" style="display:none">"><td>textE</td></tr>
</body>
Grazie mille in anticipo !!!

Rispondi quotando