WCM Forum

WCM Forum (http://www.wcm.at/forum/index.php)
-   Programmierung (http://www.wcm.at/forum/forumdisplay.php?f=17)
-   -   TinyMCE mit IBrowser - Problem (http://www.wcm.at/forum/showthread.php?t=234186)

zAPPEL 10.04.2009 10:14

Was siehst du wenn du alert(oFCKeditor); machst?
Und dann probier es einmal mit oFCKeditor.GetHTML();

Mein Code in einer Anwendung sieht so aus:
HTML-Code:

var description = FCKeditorAPI.GetInstance("description10");
var sValue = description.GetHTML();
document.getElementById("hdesc10").value = sValue;

lg

{jellyfish} 10.04.2009 12:11

Also, wenn ich den alert Befehl ausführen lasse, dann kommt das PopUp Kastl, es steht aber nix drinnen.
Danke auf jeden Fall für den geposteten Code.
Ich habe jetzt folgendes probiert, um die Variable sValue in eine PHP Variable zu bekommen.

Code:

<form action="" method="post" >
        <script type="text/javascript">
<!--
// Automatically calculates the editor base path based on the _samples directory.
// This is usefull only for these samples. A real application should use something like this:
// oFCKeditor.BasePath = '/fckeditor/' ;    // '/fckeditor/' is the default value.
var sBasePath = document.location.href.substring(0,document.location.href.lastIndexOf('_samples')) ;

var oFCKeditor = new FCKeditor( 'FCKeditor1' ) ;
oFCKeditor.BasePath    = sBasePath ;
oFCKeditor.Height    = 300 ;
oFCKeditor.Value    = '' ;
oFCKeditor.Create() ;
var description = FCKeditorAPI.GetInstance("description10");
var sValue = description.GetHTML();
document.getElementById("hdesc10").value = sValue;


//-->
        </script>
       
        <br />
        <input type="submit" value="Submit" name="absenden" />
        <?php
        if($_POST['absenden'])
        {
        echo $_POST[sValue];
        }
        ?>
    </form>

Aber das funktioniert leider auch nicht wirklich. Leider haperts an dieser Stelle bei mir beim JavaScript/PHP Zusammenspiel.
Ich möchte die Einträge nach dem Absenden nämlich in eine Datenbank speichern.
Vielen Dank für deine Hilfe.
grüsse, jellyfish

zAPPEL 10.04.2009 19:03

Hi,

mein Fehler ;), das geht ja viel einfacher als ich dachte, habe es gerade auf meinem Server ausprobiert:
HTML-Code:

<html>
<head>
    <title>FCK Editor</title>
    <script type="text/javascript" src="fckeditor/fckeditor.js"></script>
</head>
<body>
    <?php
        echo htmlentities(($_POST["FCKeditor1"]));
    ?>

    <hr />
    <form action="index.php" method="POST">
        <script type="text/javascript">
            var oFCKeditor = new FCKeditor('FCKeditor1');
            oFCKeditor.BasePath = "/fckeditor/fckeditor/";
            oFCKeditor.Create();
        </script>
        <input type="submit" value="test" />
    </form>
</body>
</html>

lg Matthias

{jellyfish} 11.04.2009 11:27

Vielen Dank Matthias!
Jetzt funktionierts - danke für deine Hilfe. Allein wär ich mit Sicherheit nicht draufgekommen.
grüsse, jellyfish


Alle Zeitangaben in WEZ +2. Es ist jetzt 03:40 Uhr.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
© 2009 FSL Verlag