Napisałam sobie następujący kod:
Kod: Zaznacz cały
<script language="javascript" type="text/javascript">
<!--
function edit() {
var o = document.getElementById("edit1");
o.style.top = document.body.scrollTop+100
o.style.left = document.body.scrollLeft+5
if (o.style.display=="block") o.style.display="none";
else o.style.display="block";
}
// -->
</script>
<style type="text/css"><!--
#edit1 {
position:absolute;
display:none;
border: 1px solid blue;
width:1000px;
height:110px;
background-color:yellow;
}
.td1 {height: 10px; width:6px;}
#chk1 {height: 10px; width:6px;}
.td2 {height: 10px; width:10px;}
#status1 {height: 10px; width:10px;}
.td3 {height: 10px; width:15px;}
#nazwa1 {height: 10px; width:15px;}
.td4 {height: 10px; width:15px;}
#haslo1 {height: 10px; width:15px;}
.td5 {height: 10px; width:15px;}
#pytanie1 {height: 10px; width:20px;}
.td6 {height: 10px; width:15px;}
#rejestracja1 {height: 10px; width:15px;}
.td7 {height: 10px; width:10px;}
#imie1 {height: 10px; width:10px;}
.td8 {height: 10px; width:15px;}
#nazwisko1 {height: 10px; width:15px;}
.td9 {height: 10px; width:6px;}
#nr_kont1 {height: 10px; width:6px;}
.td10 {height: 10px; width:15px;}
#wydzial1 {height: 10px; width:15px;}
.td11{height: 10px; width:15px;}
#funkcja1 {height: 10px; width:15px;}
.td12 {height: 10px; width:50px;}
#opcja1 {height: 10px; width:50px;}
--></style>
<span id="edit1">
<table border=1>
<tr>
<td class="td1"> </td>
<td class="td2">Status</a></td>
<td class="td3">Nazwa</a></td>
<td class="td4">Hasło</td>
<td class="td5">Pytanie</td>
<td class="td6">Data reje.</a></td>
<td class="td7">Imię</td>
<td class="td8">Nazwisko</a></td>
<td class="td9">Nr kont.</a></td>
<td class="td10">Wydz.</a></td>
<td class="td11">Fun.</a></td>
<td class="td12">Opcja</td>
</tr>
<tr><td id="chk1"> </td><td id="status1"><input type="text" size="3" onchange="document.getElementById('status').firstChild.nodeValue=this.value"></td><td id="nazwa1"><input type="text" size="15" onchange="document.getElementById('nazwa').firstChild.nodeValue=this.value"></td><td id="haslo1"><input type="text" size="15" onchange="document.getElementById('haslo').firstChild.nodeValue=this.value"></td><td id="pytanie1"><input type="text" size="20" onchange="document.getElementById('pytanie').firstChild.nodeValue=this.value"></td><td id="rejestracja1"><input type="text" size="8" onchange="document.getElementById('rejestracja').firstChild.nodeValue=this.value"></td><td id="imie1"><input type="text" size="12" onchange="document.getElementById('imie').firstChild.nodeValue=this.value"></td><td id="nazwisko1"><input type="text" size="15" onchange="document.getElementById('nazwisko').firstChild.nodeValue=this.value"></td><td id="nr_kont1"><input type="text" size="2" onchange="document.getElementById('nr_kont').firstChild.nodeValue=this.value"></td><td id="wydzial1">
<input type="text" size="6" onchange="document.getElementById('wydzial').firstChild.nodeValue=this.value"></td><td id="funkcja1"><input type="text" size="6" onchange="document.getElementById('funkcja').firstChild.nodeValue=this.value"></td><td> </td></tr>
</table>
<input type="button" value="Zapisz dane w wierszu" onclick="save();"/><input type="button" value="Zamknij okno" onclick="edit();"/>
</span>
<table id="tabela1" border=1>
<tr>
<td class="th2"> </td>
<td class="th3">Status</a></td>
<td class="th4">Nazwa</a></td>
<td class="th5">Hasło</td>
<td class="th6">Pytanie</td>
<td class="th7">Data reje.</a></td>
<td class="th8">Imię</td>
<td class="th9">Nazwisko</a></td>
<td class="th10">Nr kont.</a></td>
<td class="th11">Wydz.</a></td>
<td class="th12">Fun.</a></td>
<td class="13">Opcja</td>
</tr>
<tbody id="Sort_id">
<tr><td class="th"><input type="checkbox" name="wybor" value="1"></td><td id="status">printer</td><td id="nazwa">martinstw</td><td id="haslo">martinstw78</td><td id="pytanie">zielony</td><td id="rejestracja">19.02.1989</td><td id="imie">Maaaa</td><td id="nazwisko">PPP</td><td id="nr_kont">12345</td><td id="wydzial">WMWG- SG</td><td id="funkcja">Użytkownik2</td><td><input type="button" value="Usuń" onclick="if (confirm('Czy chcesz usunąć wiersz?')) {delete_row()}"><input type="button" value="Edytuj" onclick="edit();"></td></tr>
<tr><td class="th"><input type="checkbox" name="wybor" value="1"></td><td id="status">editor</td><td id="nazwa">marti2222</td><td id="haslo">martinmmmmm</td><td id="pytanie">czerwony</td><td id="rejestracja">17.02.1989</td><td id="imie">Mmamamma</td><td id="nazwisko">MMM</td><td id="nr_kont">23145</td><td id="wydzial">WM1111</td><td id="funkcja">Użytkownik1</td><td><input type="button" value="Usuń" onclick="if (confirm('Czy chcesz usunąć wiersz?')) {delete_row()}"><input type="button" value="Edytuj" onclick="edit();"></td></tr>
</tbody>
</table>A wierszy może być więcej.
Więc co zrobić żeby można było wpisywać dane z inputów w okienku do wierszy tabeli?