from
developer.yahoo/yui/editor/
if have a js var: [b]html[/b] how assign it to php var $htmlPhp (is the contents of textarea - var includes html code(tags))?
Getting the data from the Editor
There are a couple of ways to get the data from the editor. The first way is to let the Editor do it for you by setting the handleSubmit configuration option.
Setting the handleSubmit configuration option, the Editor will attempt to attach itself to its parent form's submit event. Then it will call its saveHTML method, then proceed with the form submission.
The manual way, is to call the saveHTML method yourself. Like this:
var myEditor = new YAHOO.widget.Editor('msgpost');myEditor.render(); //Inside an event handler after the Editor is renderedYAHOO.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;});
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 [b]html [/b]= myEditor.get('element').value;
});
- var myEditor = new YAHOO.widget.Editor('msgpost');myEditor.render(); //Inside an event handler after the Editor is renderedYAHOO.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;});
- 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 [b]html [/b]= myEditor.get('element').value;
- });