| Page 1 of 1 | [ 2 posts ] |
|
Hi
I have used the YUI 2 Rich Text Editor on my website but I am having trouble _POSTing the html (from the form) to my handle page. I am still learning Javascript and it is not so strong at the moment but I need to solve this one problem. I read on the tutorial that I should use this code: var myEditor = new YAHOO.widget.Editor('msgpost'); myEditor.render(); //Inside an event handler after the Editor is rendered YAHOO.util.Event.on('somebutton', 'click', function() { //Put the HTML back into the text area myEditor.saveHTML(); //The var html will now have the contents of the textarea var html = myEditor.get('element').value; }); but to be honest I don't really understand this - and still don't know how to put the html into the post. I tried a hidden form input with the value of html but this was unsuccessful. Can somebody please help? Thanks! Chris |
|
Chris --
When you call `myEditor.saveHTML()` that will filter the HTML inside the Editor and place it back into the textarea that the Editor was rendered from. If you want that to happen "auto-magically" you should add the `handleSubmit` config option to true when creating the Editor: Code: var myEditor = new YAHOO.widget.Editor('msgpost', { handleSubmit: true }); myEditor.render(); |
| Page 1 of 1 | [ 2 posts ] |
| You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum |
© 2006-2013 Yahoo! Inc. All rights reserved.
All code on this site is licensed under the BSD License unless stated otherwise.
About This Site · Security Contact Info
Powered by phpBB® Forum Software © phpBB Group