Results 1 to 1 of 1

Thread: tinyMCE - Keep content in textarea

  1. #1
    Join Date
    Sep 2008
    Location
    Bristol - UK
    Posts
    842
    Thanks
    32
    Thanked 132 Times in 131 Posts

    Default tinyMCE - Keep content in textarea

    Hey, I thought this would be simple but at the moment I just can't figure out how to keep the content from disappearing after submitting a form.

    Here is the code I have:

    Code:
    <script type="text/javascript" src="../js/tiny_mce.js"></script>
    <script type="text/javascript">
    tinyMCE.init({
    mode : "textareas",
    elements : 'post-content',
    theme : "advanced",
    						
    // Drop lists for link/image/media/template dialogs
    theme_advanced_buttons3_add : "preview",
    template_external_list_url : "../js/template_list.js",
    external_link_list_url : "../js/link_list.js",
    external_image_list_url : "../js/image_list.js",
    media_external_list_url : "../js/media_list.js"
    });
    </script>
    <textarea rows="20" style="width:100%" id="post-content" name="post-content"></textarea><br />
    <input type="submit" id="preview_post" name="preview_post" value="Preview"/><input type="submit" id="submit_addpost" name="submit_addpost" value="Add Post"/>
    So, when the "Preview" button is clicked, I want the text entered to stay in there. I tried using php in between the textarea like this:

    Code:
    <textarea rows="20" style="width:100%" id="post-content" name="post-content"><?php if(isset($_POST['post-content'])) echo $_POST['content']?></textarea>
    But it's not actually there, it's embedded within the javascript, any ideas?

    I've tried the "preview" plugin, but that's not really what I want.

    Fixed, seems to be working now, maybe I'm blind >.<
    Last edited by Schmoopy; 09-29-2009 at 06:09 PM.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •