à partir de
developer.yahoo/yui/editor/
Si vous avez un var JS:] [b] [HTML b / comment assigner à php $ var htmlPhp (c'est le contenu du textarea - var contient du code html (tags))?
Obtenir les données de l'éditeur
Il ya deux façons d'obtenir les données de l'éditeur. La première façon est de laisser l'éditeur de le faire pour vous en définissant l'option de configuration handleSubmit.
Définition de l'option de configuration handleSubmit, le rédacteur en chef tente de se joindre à son pare des formes non présenter l'événement. Puis il appelle sa méthode saveHTML, puis procéder à l'envoi du formulaire.
La manière manuelle, est d'appeler la méthode saveHTML vous-même. Comme ceci:
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;
- });