mbv deze functie:
output van de functie:
Weet iemand hoe ik dat kan verhelpen?
(p.s. op de oorspronkelijk pagina is dit m'n html code:
<table id="formvalues">
<tr>
</tr>
</table>)
code:
vul ik vanuit een popup een <table> tag op de pagina die de popup heeft geopend met een aantal checkboxen. Nou voegt die functie alleen geheel op eigen houtje ook allemaal <tbody> en andere <tr> tags toe waar ik nooit om gevraagd heb.1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
| <script language="javascript" type="text/javascript">
var count = 0;
function add_checkbox(no)
{
if (count == 10)
{
var nieuw = '</tr><tr>\n';
count = 0;
}
else
var nieuw = '';
nieuw = nieuw+' <td>\n\t'+no+': <input type="checkbox" name="printed['+no+']" checked>\n </td>\n';
var huidig = opener.document.getElementById('formvalues').innerHTML;
opener.document.getElementById('formvalues').innerHTML = huidig+nieuw;
count++;
}
</script> |
output van de functie:
code:
En daar ben ik niet zo blij mee, want nu komt alles onder elkaar te staan ipv per regel van 10 naast elkaar.1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
| <tbody><tr>
</tr>
</tbody> <tbody><tr><td>
260: <input type="checkbox" name="printed[260]" checked="checked">
</td></tr></tbody> <tbody><tr><td>
262: <input type="checkbox" name="printed[262]" checked="checked">
</td></tr></tbody> <tbody><tr><td>
263: <input type="checkbox" name="printed[263]" checked="checked">
</td></tr></tbody> <tbody><tr><td>
266: <input type="checkbox" name="printed[266]" checked="checked">
</td></tr></tbody> <tbody><tr><td>
267: <input type="checkbox" name="printed[267]" checked="checked">
</td></tr></tbody> <tbody><tr><td>
268: <input type="checkbox" name="printed[268]" checked="checked">
</td></tr></tbody> <tbody><tr><td>
269: <input type="checkbox" name="printed[269]" checked="checked">
</td></tr></tbody> <tbody><tr><td>
270: <input type="checkbox" name="printed[270]" checked="checked">
</td></tr></tbody> <tbody><tr><td>
271: <input type="checkbox" name="printed[271]" checked="checked">
</td></tr></tbody> <tbody><tr><td>
272: <input type="checkbox" name="printed[272]" checked="checked">
</td></tr></tbody><tbody><tr>
<td>
273: <input type="checkbox" name="printed[273]" checked="checked">
</td></tr></tbody> <tbody><tr><td>
274: <input type="checkbox" name="printed[274]" checked="checked">
</td></tr></tbody> |
Weet iemand hoe ik dat kan verhelpen?
(p.s. op de oorspronkelijk pagina is dit m'n html code:
<table id="formvalues">
<tr>
</tr>
</table>)