Rich Text Editor (YUI Simple Text Editor used) not sending data to next page

Posted by Aman Chhabra on Stack Overflow See other posts from Stack Overflow or by Aman Chhabra
Published on 2013-07-04T12:27:58Z Indexed on 2013/08/02 15:37 UTC
Read the original article Hit count: 420

Filed under:
|
|

I am using a simple text editor from YUI, but when I click submit the code in the textarea/editor is not sent to the next page. I want to be able to receive it on the subsequent page and then store it in a DB(MySql). I have wasted lot of time already. Please help. HTML FILE:

<html>
<head>
<script type="text/javascript" src="http://yui.yahooapis.com/combo?2.9.0/build/yahoo-dom-event/yahoo-dom-event.js&2.9.0/build/container/container_core-min.js&2.9.0/build/element/element-min.js&2.9.0/build/editor/simpleeditor-min.js"></script>
<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.9.0/build/editor/assets/skins/sam/simpleeditor.css" />
<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.8.2r1/build/assets/skins/sam/skin.css">
<!-- Utility Dependencies -->
<script src="http://yui.yahooapis.com/2.8.2r1/build/yahoo-dom-event/yahoo-dom-event.js"></script> 
<script src="http://yui.yahooapis.com/2.8.2r1/build/element/element-min.js"></script> 
<!-- Needed for Menus, Buttons and Overlays used in the Toolbar -->
<script src="http://yui.yahooapis.com/2.8.2r1/build/container/container_core-min.js"></script>
<script src="http://yui.yahooapis.com/2.8.2r1/build/menu/menu-min.js"></script>
<script src="http://yui.yahooapis.com/2.8.2r1/build/button/button-min.js"></script>
<!-- Source file for Rich Text Editor-->
<script src="http://yui.yahooapis.com/2.8.2r1/build/editor/editor-min.js"></script>
<script>
YAHOO.util.Event.on('submit', 'click', function() {
myEditor.saveHTML(); 
var html = myEditor.get('element').value;
});
(function() { 
        var Dom = YAHOO.util.Dom, 
        Event = YAHOO.util.Event; 

        var myConfig = { 
                height: '200px', 
                width: '900px', 
                dompath: true,                   
            }; 
        myEditor = new YAHOO.widget.SimpleEditor('msgpost', myConfig); 
        myEditor.render(); 


})();       
</script>

</head>

<body class="yui-skin-sam">
<form action="submit.php" method="post">
    <textarea name="msgpost" id="msgpost" cols="50" rows="10"></textarea>
<input type="submit" value="Submit" onsubmit="return myDoSubmit()"/>
</form>
</body>
</html>

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about yui