Ciao ragazzi,
mi serve il vostro aiuto.
Ho creato con un codice una tabella dove l'utente possa inserire i dati di cui ho bisogno.
Questa funziona e visualizza subito sotto quello che io ho scritto.
Mi servirebbe di creare un filtro dove io possa ricercare, dato una parola dall'utente il tipo di protocollo, l'anno, entrata o uscita e cliente fornitore.
Vi lascio il codice qui.
Spero voi mi possiate aiutare,
Grazi mille.
Codice HTML:
<html>
<head></head>
<script>
var NOME = new Array();
var COGNOME = new Array();
var CLASSE = new Array();
var NASCITA = new Array();
N=0;
function Memorizza()
{
NOME[N]=document.getElementById("TxtNom").value;
COGNOME[N]=document.getElementById("TxtCog").value;
CLASSE[N]=document.getElementById("TxtCla").value;
NASCITA[N]=document.getElementById("TxtNas").value;
N++;
Visualizza();
}
function Visualizza()
{
STRINGA=""
STRINGA="<table><tr><br><br><td>Tipo di Protocollo</td><td>Entrata o Uscita</td><td>Cliente o Fornitore</td><td>Anno</td></tr>";
for (I=0;I<N;I++)
{
STRINGA+="<tr><td>"+NOME[I]+"</td><td>"+COGNOME[I]+"</td><td>"+CLASSE[I]+"</td><td>"+NASCITA[I]+"</td></tr>";
}
STRINGA+="</table>";
document.getElementById("Display").innerHTML = STRINGA;
}
</script>
<style>
table{border: inset red 5px;}
td{border: solid red 10px; text-align: center;}
</style>
<body>
<center>
<table>
<tr>
<td colspan="5">Nuovo Protocollo</td>
</tr>
<tr>
<td>Tipo di protocollo</td>
<td><input type="text" id="TxtNom"></td>
</tr>
<tr>
<td>Entrata o uscita</td>
<td><input type="text" id="TxtCog"></td>
</tr>
<tr>
<td>Cliente o fornitore</td>
<td><input type="text" id="TxtCla"></td>
</tr>
<tr>
<td>Anno</td>
<td><input type="text;" id="TxtNas"></td>
</tr>
<tr>
<td colspan="10"><input type="submit" id="BtnAggiungi" Value="Aggiungi" onclick="Memorizza()"> <input type="submit" name="BtnChiudi" Value="Chiudi"></td>
</tr>
</table>
<div id="Display"></div>
</center>
</body>
</html>