Solved

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

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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

758 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now