Probleem: waarden van checkboxen en andere elementen die in een div staan resetten als ik in de parent div iets toevoeg.
Met createElement en appendChild ben ik niet echt bekend (weet dat het bestaat), maar met die werkwijze gaat dat probleem zich niet stellen?
De code:
(komt in een asp.net app)
code:
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head id="Head1"><title>
New User
</title>
<style>
.a
{
font-size: 12px;
padding: 1px;
letter-spacing: 0.06em ;
line-height: 140%;
font-family: tahoma, arial, sans-serif;
margin-left: 0px;
}
.title
{
font-size: 14px;
padding: 1px;
letter-spacing: 0.06em ;
line-height: 140%;
font-family: tahoma, arial, sans-serif;
margin-left: 0px;
border-bottom: 2px solid #CCCCCC;
}
.myTd
{
border-bottom: 1px solid #CCCCCC;
}
body
{
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
font-weight: normal;
padding: 0px;
line-height: 140%;
}
input
{
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
font-weight: normal;
padding: 0px;
line-height: 140%;
}
.infomessageCENTERED
{
color:#006600;
/*height:45px;
*/
display:block;
margin:5px;
padding: 6px;
padding-left: 60px;
background-color:#E9F5E2;
background-image: url('check.gif');
background-repeat: no-repeat;
background-position: 3px center;
border: 1px solid #006600;
width:400px;
margin-left: auto; /* 164px; */
margin-right: auto;
display: block;
}
.infomessageLEFT
{
color:#006600;
/*height:45px;
*/
display:block;
margin:5px;
padding: 6px;
padding-left: 60px;
background-color:#E9F5E2;
background-image: url('check.gif');
background-repeat: no-repeat;
background-position: 3px center;
border: 1px solid #006600;
width:400px;
margin-left: 0; /* 164px; */
margin-right: auto;
display: block;
}
.alertmessageLEFT
{
color:#660000;
/*height:45px;
*/
display:block;
margin:5px;
padding: 6px;
padding-left: 60px;
background-color:#F5CBC8;
background-image: url('check.gif');
background-repeat: no-repeat;
background-position: 3px center;
border: 1px solid #006600;
width:400px;
margin-left: 0; /* 164px; */
margin-right: auto;
display: block;
}
.kader
{
color:#000000;
display:block;
margin:5px;
padding: 6px;
padding-left: 30px;
background-color:#F0F0F0;
background-image: url('check.gif');
background-repeat: no-repeat;
background-position: 3px center;
border: 1px solid #222222;
width:800px;
margin-left: 60px; /* 164px; */
margin-right: auto;
display: block;
}
</style>
<script language="javascript">
var i = 2;
function addMapRow()
{
i++;
var newLine;
newLine = "<div id=\"maprow" + i + "\">[img]\"browse.gif\">[/img] <input type=\"checkbox\" name='lezen'>Lezen <input type=\"checkbox\" name='schrijven'>Schrijven <input type=\"checkbox\" onClick=\"toggleAnders(" + i + ", this);\" name='anders'>Anders: <span style='visibility:hidden;' id=\"anders" + i + "\"><input type=\"text\" size=\"50\" name='andersTekst'></span> [img]\"delete.gif\"[/img]</div>";
document.getElementById("maplijst").innerHTML += newLine;
}
function removeMapRow(j)
{
document.getElementById("maprow" + j + "").innerHTML = "";
document.getElementById("maprow" + j + "").style.display = 'none';
}
function toggleAnders(j, o)
{
if(o.checked == true)
{
document.getElementById("anders" + j + "").style.visibility = "visible";
}
else
{
document.getElementById("anders" + j + "").style.visibility = "hidden";
}
}
</script>
</head>
<body>
<p class="infomessageLEFT">Algemene informatie</p>
<div class="kader">
<table>
<tr>
<td width="100">Naam</td>
<td><input type="textbox" size="50"></td>
</tr>
<tr>
<td width="100">Voornaam</td>
<td><input type="textbox" size="50"></td>
</tr>
<tr>
<td width="100">Afdeling</td>
<td><input type="textbox" size="50"></td>
</tr>
<tr>
<td width="100">Chef</td>
<td><input type="textbox" size="50"></td>
</tr>
<tr>
<td width="100">Ingevuld door</td>
<td><input type="textbox" size="50" readonly value=""></td>
</tr>
</table>
</div>
<br>
<p class="infomessageLEFT">Groepen waarvan de gebruiker lid moet worden</p>
<div class="kader">
<table>
<tr>
<td width="150"><input type="checkbox" name="a">a</td>
<td width="150"><input type="checkbox" name="b">b</td>
<td width="150"><input type="checkbox" name="c">c</td>
<td width="150"><input type="checkbox" name="d">d</td>
<td width="150"><input type="checkbox" name="e">e</td>
</tr>
</table>
</div>
<br>
<p class="infomessageLEFT">Mappen waar de gebruiker toegang tot heeft en de berechtiging</p>
<div class="kader">
<div id="maplijst">
[img]"browse.gif">[/img] <input type="checkbox">Lezen <input type="checkbox">Schrijven <input type="checkbox">Anders: <input type="text" size="50"> [img]"delete.gif">
<br>
<img[/img] <input type="text" size="50"> <input type="checkbox">Lezen <input type="checkbox">Schrijven <input type="checkbox">Anders: <input type="text" size="50"> [img]"delete.gif">
<br>
</div>
<br>
<img[/img] Map toevoegen
</div>
<br>
<p class="alertmessageLEFT">Waarschuwing</p>
<div class="kader">
<input type="checkbox"> Ik verklaar deze informatie voor echt en ben zelf verantwoordelijk voor deze aanvraag.
<br>
<br>
<br>
<input type="submit" value="Aanvraag versturen">
</div>
</body>
</html> |
[
Voor 21% gewijzigd door
Verwijderd op 04-05-2006 14:18
]