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
Solved

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

Posted on 2009-07-14
2
560 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
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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Color can increase conversions, create feelings of warmth or even incite people to get behind a cause. If you want your website to really impact site visitors, then it is vital to consider the impact color has on them.
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

839 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