Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2009-07-14
2
Medium Priority
?
569 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
When the s#!t hits the fan, you don’t have time to look up who’s on call, draft emails, call collaborators, or send text messages. An instant chat window is definitely the way to go, especially one like HipChat. HipChat is a true business app. An…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
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…

824 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