Wat doe ik fout (opgelost)
Code (php)
1
2
3
4
2
3
4
<span id="Image" style="display:none;">
<p><a class="tooltip" href="#">'.$right_menu_image.'<span>'.$right_menu_insert_image.'</span></a></p>
<input type="text" name="link1" id="link1" value="" size="40" /><IMG SRC="./images/searchfolder.png" id="picture" onclick="openFileBrowser(link1);" />
</span>
<p><a class="tooltip" href="#">'.$right_menu_image.'<span>'.$right_menu_insert_image.'</span></a></p>
<input type="text" name="link1" id="link1" value="" size="40" /><IMG SRC="./images/searchfolder.png" id="picture" onclick="openFileBrowser(link1);" />
</span>
dit is de gehele script.
Wat doe ik fout ik zit al uren te staren, ik kom er niet meer uit.
Alvast bedankt voor de hulp ;)
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
96
97
98
99
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
<script type="text/javascript">
function setlink (objDropDown)
{
var objHidden = document.getElementById("link");
var type = objDropDown.options[objDropDown.selectedIndex].text.substring(objDropDown.options[objDropDown.selectedIndex].text.indexOf('-')+1, objDropDown.options[objDropDown.selectedIndex].text.length);
objHidden.value = type;
}
function showEntry(obj,optionValue)
{
//hide all entry selections onchange
document.getElementById("Image").style.display="none";
if(obj.value=="Image")
{
document.getElementById(optionValue).style.display="inline";
}
}
function showEntry2(obj,optionValue)
{
//hide all entry selections onchange
document.getElementById("Youtube").style.display="none";
if(obj.value=="Youtube")
{
document.getElementById(optionValue).style.display="inline";
}
}
</script>
<?php
$dir = "./../data/right_menu";
echo '
<table>
<caption>'.$right_menu_new.'</caption>
<thead>';
if($_SERVER['REQUEST_METHOD'] == 'POST'){
if(empty($_POST['title']))
$error .= '<tr><td><span id="red">* '.$right_menu_error_title.'</span></td></tr>';
if( $error ){
echo "" . $error . "";
} else {
$title = $_POST["title"];
$link1 = $_POST["link1"];
$link2 = $_POST["link2"];
$content = '<?php
$link1 = "'.$link1.'";
$link2 = "'.$link2.'";
$right_menu_title = "'.$title.'";
?>';
include "./page/URLstring.php";
$url = URLstring($title);
$file = fopen ("$dir/".$url."-".$randomname.".php", "w");
fwrite($file, $content);
fclose($file);
chmod ("$dir/".$url."-".$randomname.".php", 0777);
echo '<tr><td><IMG SRC="./images/true.png"> '.$Gsucces.'</td></tr>';
}}
if( (!empty($error)) or $_SERVER['REQUEST_METHOD'] != "POST" )
{
$title = isset($_POST['title']) ? $_POST['title'] : '';
echo '
<form method="post" action="#">
<tr>
<td><span id="red">* '.$Grequired.'</span></td>
</tr>
</thead>
<tbody>
<tr>
<td><a class="tooltip" href="#">'.$Gtitle.'<span>'.$right_menu_title_n.'</span></a><span id="red"> *</span></td>
</tr>
<tr>
<td><input name="title" value="'.$title.'" type="text" size="40"></td>
</tr>
<tr>
<td>'.$right_menu_type.'</td>
</tr>
<tr>
<td>
<select onchange="showEntry(this,this.value);showEntry2(this,this.value);" name="linkselectbox">
<option value="">'.$right_menu_link_type.'</option>
<option value="Image">'.$Gimage.'</option>
<option value="Youtube">'.$GYoutube.'</option>
</select>
<span id="Image" style="display:none;">
<p><a class="tooltip" href="#">'.$right_menu_image.'<span>'.$right_menu_insert_image.'</span></a></p>
<input type="text" name="link1" id="link1" value="" size="40" /><IMG SRC="./images/searchfolder.png" id="picture" onclick="openFileBrowser(link1);" />
</span>
<span id="Youtube" style="display:none;">
<p><a class="tooltip" href="#">'.$right_menu_youtube.'<span>'.$right_menu_insert_youtube.'</span></a></p>
<input type="text" name="link2" id="link2" value="" size="40" />
</span>
</td>
</tr>
<tr>
<td width="75%"><button type="submit" class="positive" name="submit"><img src="./images/saveitem.png" width="16" height="16"/> '.$Gsave.' </button></td>
</tr>
</table>
</form>';
} ?>
function setlink (objDropDown)
{
var objHidden = document.getElementById("link");
var type = objDropDown.options[objDropDown.selectedIndex].text.substring(objDropDown.options[objDropDown.selectedIndex].text.indexOf('-')+1, objDropDown.options[objDropDown.selectedIndex].text.length);
objHidden.value = type;
}
function showEntry(obj,optionValue)
{
//hide all entry selections onchange
document.getElementById("Image").style.display="none";
if(obj.value=="Image")
{
document.getElementById(optionValue).style.display="inline";
}
}
function showEntry2(obj,optionValue)
{
//hide all entry selections onchange
document.getElementById("Youtube").style.display="none";
if(obj.value=="Youtube")
{
document.getElementById(optionValue).style.display="inline";
}
}
</script>
<?php
$dir = "./../data/right_menu";
echo '
<table>
<caption>'.$right_menu_new.'</caption>
<thead>';
if($_SERVER['REQUEST_METHOD'] == 'POST'){
if(empty($_POST['title']))
$error .= '<tr><td><span id="red">* '.$right_menu_error_title.'</span></td></tr>';
if( $error ){
echo "" . $error . "";
} else {
$title = $_POST["title"];
$link1 = $_POST["link1"];
$link2 = $_POST["link2"];
$content = '<?php
$link1 = "'.$link1.'";
$link2 = "'.$link2.'";
$right_menu_title = "'.$title.'";
?>';
include "./page/URLstring.php";
$url = URLstring($title);
$file = fopen ("$dir/".$url."-".$randomname.".php", "w");
fwrite($file, $content);
fclose($file);
chmod ("$dir/".$url."-".$randomname.".php", 0777);
echo '<tr><td><IMG SRC="./images/true.png"> '.$Gsucces.'</td></tr>';
}}
if( (!empty($error)) or $_SERVER['REQUEST_METHOD'] != "POST" )
{
$title = isset($_POST['title']) ? $_POST['title'] : '';
echo '
<form method="post" action="#">
<tr>
<td><span id="red">* '.$Grequired.'</span></td>
</tr>
</thead>
<tbody>
<tr>
<td><a class="tooltip" href="#">'.$Gtitle.'<span>'.$right_menu_title_n.'</span></a><span id="red"> *</span></td>
</tr>
<tr>
<td><input name="title" value="'.$title.'" type="text" size="40"></td>
</tr>
<tr>
<td>'.$right_menu_type.'</td>
</tr>
<tr>
<td>
<select onchange="showEntry(this,this.value);showEntry2(this,this.value);" name="linkselectbox">
<option value="">'.$right_menu_link_type.'</option>
<option value="Image">'.$Gimage.'</option>
<option value="Youtube">'.$GYoutube.'</option>
</select>
<span id="Image" style="display:none;">
<p><a class="tooltip" href="#">'.$right_menu_image.'<span>'.$right_menu_insert_image.'</span></a></p>
<input type="text" name="link1" id="link1" value="" size="40" /><IMG SRC="./images/searchfolder.png" id="picture" onclick="openFileBrowser(link1);" />
</span>
<span id="Youtube" style="display:none;">
<p><a class="tooltip" href="#">'.$right_menu_youtube.'<span>'.$right_menu_insert_youtube.'</span></a></p>
<input type="text" name="link2" id="link2" value="" size="40" />
</span>
</td>
</tr>
<tr>
<td width="75%"><button type="submit" class="positive" name="submit"><img src="./images/saveitem.png" width="16" height="16"/> '.$Gsave.' </button></td>
</tr>
</table>
</form>';
} ?>
Gewijzigd op 01/06/2012 14:37:15 door Sander van Viegen
Code (php)
1
2
3
4
2
3
4
<span id="Image" style="display:none;">
<p><a class="tooltip" href="#">'.$right_menu_image.'<span>'.$right_menu_insert_image.'</span></a></p>
<input type="text" name="link1" id="link1" value="" size="40" /><IMG SRC="./images/searchfolder.png" id="picture" onclick="openFileBrowser(link1);" />
</span>
<p><a class="tooltip" href="#">'.$right_menu_image.'<span>'.$right_menu_insert_image.'</span></a></p>
<input type="text" name="link1" id="link1" value="" size="40" /><IMG SRC="./images/searchfolder.png" id="picture" onclick="openFileBrowser(link1);" />
</span>
Dit werkt natuurlijk niet, je gebruikt hier een PHP variabel in HTML ($right_menu_insert_image)
de style="display:none;"> weghaal dan zie ik hem wel alleen is hij niet verborgen wat ik wil.
Help...
Waarom voeg je niet gewoon display:none; toe aan je Image{} in je css?
het is een soort van keuze menu.
Toevoeging op 01/06/2012 14:37:47:
ik had een fout in mijn css staan @ Chris NVT bedankt voor de moeite