Menu

Codepress with filemaneger

2008-03-29
2013-04-24
  • Nobody/Anonymous

    Hello,

    First: I come from Holland. My English is not so good.

    I will use codepress for a file maneger. I have make the follow code:

    <form method="post">
                <textarea name="file" id="file" onsubmit="updateMyCpTextarea" style="width: 100%; height:500px;" id="myCpWindow" class="codepress php"><?php echo $text; ?></textarea>
                <input type="submit" name="save" value="Opslaan" style="height:5%; width: 50% float: left;">
                <input type="submit" name="save_close" value="Opslaan en editor sluiten" style="height:5%; width: 50% float: right;">
                </form>';
                echo '<script type="text/javascript">
                function updateMyCpTextarea(submitButton) {
                    document.getElementById(\'file\').value = file.getCode();
                    return true;
                }
            </script>
    this code work good, he higlight the code, but, if i save the form is the array $_POST['file'] empty.

     
    • Nobody/Anonymous

      Hello,

      I had the same Problem.
      To fix this you should call toggleEditor() before you submit the form:

      <input type="submit" value="save" onmousedown="codepresswindow.toggleEditor();">

      In your code:

      <form method="post">
      <textarea name="file" id="file" onsubmit="updateMyCpTextarea" style="width: 100%; height:500px;" id="myCpWindow" class="codepress php"><?php echo $text; ?></textarea>
      <input type="submit" name="save" onmousedown="codepresswindow.toggleEditor();" value="Opslaan" style="height:5%; width: 50% float: left;">
      <input type="submit" name="save_close" onmousedown="codepresswindow.toggleEditor();" value="Opslaan en editor sluiten" style="height:5%; width: 50% float: right;">
      </form>

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.