Solved

textarea not being posted as form data - yui rich text editor

Posted on 2009-07-14
2
565 Views
Last Modified: 2013-11-19
Hi all,

I am trying to design a customized version of Rich text editor using YUI library. I've done everything that is mentioned in the documentation, but the data from underlying textarea is not being submitted as POST data to the action script. As soon as I remove the YUI RTE code, the data gets submitted properly. The code is attached. I could see that the POST data does not contain entry for "full_description" if I enable the rich text editor part, but I could see the same when I disable it.

I have wasted many hours now .. and still not able to figure out what is wrong here. Can anybody help me finding out the issue?

TIA,
--Venkat.
<form action="action.php" method="POST"  id="form2"  name="form2"  onsubmit="return check_data();" enctype="multipart/form-data">
<textarea name="full_description" id="full_description" cols="50" rows="10"></textarea>
.
.
.
<script type="text/javascript">
 var myEditor = new YAHOO.widget.Editor('full_description', 
                                       { height: '500px', width: '722px', .... });
myEditor.render();
 
YAHOO.util.Event.on('update_desc_button', 'click', function() {
      //Put the HTML back into the text area
       myEditor.saveHTML();
});
</script>
 
<input type="submit" name="update_desc_button" id="update_desc_button" value="Update"/>
</form>

Open in new window

0
Comment
Question by:venkat_pedapati
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 5

Expert Comment

by:Koma666
ID: 24869419
Did you follow the example on: http://developer.yahoo.com/yui/examples/editor/post_editor.html
you need some callback funtions to get this done.

And I think you need to set the functions for the save button:

You need to change this code from the tutorial to fit your needs:

var _button = new YAHOO.widget.Button('submitEditor');

    _button.on('click', function(ev) {
        YAHOO.log('Button clicked, initiate transaction', 'info', 'example');
        Event.stopEvent(ev);
        myEditor.saveHTML();
        window.setTimeout(function() {
            var sUrl = "assets/post.php";
            var data = 'filter=' + ((Dom.get('filter').checked) ? 'yes' : 'no') + '&editor_data=' + encodeURIComponent(myEditor.get('textarea').value);
            var request = YAHOO.util.Connect.asyncRequest('POST', sUrl, callback, data);
        }, 200);
    });
0
 

Accepted Solution

by:
venkat_pedapati earned 0 total points
ID: 25232589
I could not get this to work. I have switched to tinymce for now. Will reopen this question when I switch back later ..
0

Featured Post

Major Serverless Shift

Comparison of major players like AWS, Microsoft Azure, IBM Bluemix, and Google Cloud Platform

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
Originally, this post was published on Monitis Blog, you can check it here . Websites are getting bigger and more complicated by the day. Video, images and custom fonts are all great for showcasing your product or service. But the price to pay in…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

632 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question