Forum de discussion
Forum « Programmation ASP » (archives)
Re: rafraichissement automatique du'ne page asp
Envoyé: 29 octobre 2004, 12h41 par Salem
<script language="javascript">
var glob;
glob = 0;
function insert_row() {
var the_table = document.getElementById("ta_table");
var new_row_index = the_table.rows.length;
glob = glob + 1;
the_table.insertRow(new_row_index);
the_table.rows[new_row_index].insertCell(0);
the_table.rows[new_row_index].cells[0].innerHTML = ' Ligne '+ glob +'';
document.f.glob.value=glob;
}
function delete_row() {
var the_table = document.getElementById("ta_table");
var row_index = the_table.rows.length - 1;
the_table.deleteRow(row_index);
glob = glob - 1;
document.f.glob.value=glob;
}
</script>
<body onload="insert_row()">
<form name="f">
<table id="ta_table" border="1">
<tr><td><input type="button" value=" - " onclick="delete_row();"> <input type="button" value=" + " onclick="insert_row();"></td></tr>
</table>
</form>
</body>
Réponses
|