Nieuw lid |
|
Psycho schreef: [..quote..]
Dat vroeg hij niet, hij vroeg hoe hij een plaatje in zijn textarea kon laten zien. Hou je aan de topicÂ
ja maar die vrager dat ben ik
Het is me gelukt!
<html>
<head>
<script language="javascript">
function maak_frame(){
// IE en FF werken anders: dus kijkt hij hoe hij het moet toepassen
if(window.navigator.appName == "Microsoft Internet Explorer")
iframe.document.designMode = "on";
if(window.navigator.appName == "Netscape")
document.getElementById('iframe').contentDocument.designMode = "on";
}
function smilie(welke)
{
var imgSrc = "http://www.moviexp.nl/beta/smilies/"+ welke + ".gif";
if(imgSrc != null)
document.getElementById("iframe").contentWindow.document.execCommand('insertimage', false, imgSrc);
}
function vet() {
document.getElementById("iframe").contentWindow.document.execCommand("bold", false, null);
}
function schuin() {
document.getElementById("iframe").contentWindow.document.execCommand("italic", false, null);
}
function onderstreept() {
document.getElementById("iframe").contentWindow.document.execCommand("underline", false, null);
}
function opslaan() {
var htmlCode = document.getElementById('iframe').contentWindow.document.body.innerHTML;
document.getElementById("areaCode").value = htmlCode;
document.getElementById("formCode").submit();
}
</script>
</head>
<body onLoad="maak_frame()">
<iframe id="iframe" height="200" width="400"></iframe><br><br>
<form action="" method="post" id="formCode" style="display: none;">
<textarea name="areaCode" id="areaCode"></textarea>
</form>
<input type="button" onclick=vet(); value="Vet"> <input type="button" onclick=schuin(); value="schuin"> <input type="button" onclick=onderstreept(); value="onderstreept">
<input type="hidden" name="areaCode" id="areaCode">
<input type="button" onclick="opslaan()"; value="Opslaan!">
</form>
<?
if(isset($_POST['areaCode']) && $_POST['areaCode'] != ""){
echo stripslashes($_POST['areaCode']);
?>
<html> <head> <script language="javascript"> function maak_frame(){ // IE en FF werken anders: dus kijkt hij hoe hij het moet toepassen if(window.navigator.appName == "Microsoft Internet Explorer") iframe.document.designMode = "on"; if(window.navigator.appName == "Netscape") document.getElementById('iframe').contentDocument.designMode = "on"; } function smilie(welke) { var imgSrc = "http://www.moviexp.nl/beta/smilies/"+ welke + ".gif"; if(imgSrc != null) document.getElementById("iframe").contentWindow.document.execCommand('insertimage', false, imgSrc); } function vet() { document.getElementById("iframe").contentWindow.document.execCommand("bold", false, null); } function schuin() { document.getElementById("iframe").contentWindow.document.execCommand("italic", false, null); } function onderstreept() { document.getElementById("iframe").contentWindow.document.execCommand("underline", false, null); } function opslaan() { var htmlCode = document.getElementById('iframe').contentWindow.document.body.innerHTML; document.getElementById("areaCode").value = htmlCode; document.getElementById("formCode").submit(); } </script> </head> <body onLoad="maak_frame()"> <iframe id="iframe" height="200" width="400"></iframe><br><br> <form action="" method="post" id="formCode" style="display: none;"> <textarea name="areaCode" id="areaCode"></textarea> </form> <input type="button" onclick=vet(); value="Vet"> <input type="button" onclick=schuin(); value="schuin"> <input type="button" onclick=onderstreept(); value="onderstreept"> <input type="hidden" name="areaCode" id="areaCode"> <input type="button" onclick="opslaan()"; value="Opslaan!"> </form> <? if(isset($_POST['areaCode']) && $_POST['areaCode'] != ""){ echo stripslashes($_POST['areaCode']); ?>
|