JS
Code (php)
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
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
<html>
<head>
<script language="JavaScript">
var x = 0
var style = new Array()
style[0] = "[B]"
style[1] = "[/B]"
style[2] = "[I]"
style[3] = "[/I]"
style[4] = "[U]"
style[5] = "[/U]"
style[6] = "[ALIGN=center]"
style[7] = "[/ALIGN]"
style[8] = "[ALIGN=right]"
style[9] = "[/ALIGN]"
var value = new Array()
value[0] = "B"
value[1] = "B*"
value[2] = "I"
value[3] = "I*"
value[4] = "U"
value[5] = "U*"
value[6] = ""
value[7] = "*"
value[8] = ""
value[9] = "*"
function addStyle(f,s)
{
if(x==0){
var v = document.getElementById("content").value
document.getElementById("content").value=v+style[f]
document.getElementById(f).value=value[s]
x=1
for(i=0;i<10;i++){
if(f!=i){
document.getElementById(i).disabled=true
}
}
}else{
var v = document.getElementById("content").value
document.getElementById("content").value=v+style[s]
document.getElementById(f).value=value[f]
x=0
for(i=0;i<10;i++){
if(f!=i){
document.getElementById(i).disabled=false
}
}
}
}
</script>
<title>Untitled Document</title>
<link rel="stylesheet" href="css/style.css" title="stylesheet" media="screen" type="text/css">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body class="content">
<table width="500" align="center">
<tr>
<th colspan="2" align="left">New subject</th>
</tr>
<tr>
<td width="32%" align="right">Subject:</td>
<td width="68%" align="left"><input type="text" name="subj"></td>
</tr>
<tr>
<td width="32%" align="right">Description:</td>
<td width="68%" align="left"><textarea name="description" cols="50"></textarea></td>
</tr>
<tr>
<td width="32%" align="right"></td>
<td width="68%" align="left">
<input type="button" onClick="addStyle('0', '1')" id="0" value="B">
<input type="button" onClick="addStyle('2', '3')" id="2" value="I">
<input type="button" onClick="addStyle('4', '5')" id="4" value="U">
<input type="button" onClick="addStyle('6', '7')" id="6" value=" ">
<input type="button" onClick="addStyle('8', '9')" id="8" value=" ">
</td>
</tr>
<tr>
<td width="32%" align="right" valign="top">Content:</td>
<td width="68%" align="left"><textarea name="content" cols="50" rows="10"></textarea></td>
</tr>
<tr>
<td width="32%" align="right"></td>
<td width="68%" align="left"><input type="button" onClick="" value="Preview"><input type="submit" name="submit" value="Submit"></td>
</tr>
</table>
</body>
</html>
<head>
<script language="JavaScript">
var x = 0
var style = new Array()
style[0] = "[B]"
style[1] = "[/B]"
style[2] = "[I]"
style[3] = "[/I]"
style[4] = "[U]"
style[5] = "[/U]"
style[6] = "[ALIGN=center]"
style[7] = "[/ALIGN]"
style[8] = "[ALIGN=right]"
style[9] = "[/ALIGN]"
var value = new Array()
value[0] = "B"
value[1] = "B*"
value[2] = "I"
value[3] = "I*"
value[4] = "U"
value[5] = "U*"
value[6] = ""
value[7] = "*"
value[8] = ""
value[9] = "*"
function addStyle(f,s)
{
if(x==0){
var v = document.getElementById("content").value
document.getElementById("content").value=v+style[f]
document.getElementById(f).value=value[s]
x=1
for(i=0;i<10;i++){
if(f!=i){
document.getElementById(i).disabled=true
}
}
}else{
var v = document.getElementById("content").value
document.getElementById("content").value=v+style[s]
document.getElementById(f).value=value[f]
x=0
for(i=0;i<10;i++){
if(f!=i){
document.getElementById(i).disabled=false
}
}
}
}
</script>
<title>Untitled Document</title>
<link rel="stylesheet" href="css/style.css" title="stylesheet" media="screen" type="text/css">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body class="content">
<table width="500" align="center">
<tr>
<th colspan="2" align="left">New subject</th>
</tr>
<tr>
<td width="32%" align="right">Subject:</td>
<td width="68%" align="left"><input type="text" name="subj"></td>
</tr>
<tr>
<td width="32%" align="right">Description:</td>
<td width="68%" align="left"><textarea name="description" cols="50"></textarea></td>
</tr>
<tr>
<td width="32%" align="right"></td>
<td width="68%" align="left">
<input type="button" onClick="addStyle('0', '1')" id="0" value="B">
<input type="button" onClick="addStyle('2', '3')" id="2" value="I">
<input type="button" onClick="addStyle('4', '5')" id="4" value="U">
<input type="button" onClick="addStyle('6', '7')" id="6" value=" ">
<input type="button" onClick="addStyle('8', '9')" id="8" value=" ">
</td>
</tr>
<tr>
<td width="32%" align="right" valign="top">Content:</td>
<td width="68%" align="left"><textarea name="content" cols="50" rows="10"></textarea></td>
</tr>
<tr>
<td width="32%" align="right"></td>
<td width="68%" align="left"><input type="button" onClick="" value="Preview"><input type="submit" name="submit" value="Submit"></td>
</tr>
</table>
</body>
</html>
document.getElementById('content') has no properties
Gewijzigd op 01/01/1970 01:00:00 door Niek Berckmans
Maak daar eens van:
<textarea name="content" id="content" cols="50" rows="10"></textarea>
Iemand nog een idee hoe ik dat probleem met het disablen kan oplossen?
Wat is je volgende foutmelding?
(sorry voor de late reactie...training)
http://www.orange-clan.com/newsub.html
Gewijzigd op 01/01/1970 01:00:00 door Niek Berckmans
for(i=0;i<10;i++){
te vervangen door
for(i=0;i<10;i=i+2){
Code (php)
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
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
<script language="JavaScript">
var style = new Array()
style[0] = "[B]"
style[1] = "[/B]"
style[2] = "[I]"
style[3] = "[/I]"
style[4] = "[U]"
style[5] = "[/U]"
style[6] = "[ALIGN=center]"
style[7] = "[/ALIGN]"
style[8] = "[ALIGN=right]"
style[9] = "[/ALIGN]"
function addStyle(f,s)
{
if (window.getSelection)
{
txt = window.getSelection();
}
else if (document.getSelection)
{
txt = document.getSelection();
}
else if (document.selection)
{
txt = document.selection.createRange().text;
}
if(txt)
{
document.selection.createRange().text =style[f]+txt+ style[s]
document.getElementById("content").focus()
}else{
document.getElementById("content").value+=style[f]+style[s]
document.getElementById("content").focus()
}
}
</script>
var style = new Array()
style[0] = "[B]"
style[1] = "[/B]"
style[2] = "[I]"
style[3] = "[/I]"
style[4] = "[U]"
style[5] = "[/U]"
style[6] = "[ALIGN=center]"
style[7] = "[/ALIGN]"
style[8] = "[ALIGN=right]"
style[9] = "[/ALIGN]"
function addStyle(f,s)
{
if (window.getSelection)
{
txt = window.getSelection();
}
else if (document.getSelection)
{
txt = document.getSelection();
}
else if (document.selection)
{
txt = document.selection.createRange().text;
}
if(txt)
{
document.selection.createRange().text =style[f]+txt+ style[s]
document.getElementById("content").focus()
}else{
document.getElementById("content").value+=style[f]+style[s]
document.getElementById("content").focus()
}
}
</script>
Bedankt voor de moeite!
Gewijzigd op 01/01/1970 01:00:00 door Niek Berckmans