if have a js var: html - how assign it to php var $htmlPhp

  • lse123
  • Born
  • Born
  • lse123
  • Posts: 3

Post 3+ Months Ago

from
Code: [ Select ]
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:

JAVASCRIPT Code: [ Select ]
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;
});
  1. 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;});
  2. var myEditor = new YAHOO.widget.Editor('msgpost');
  3. myEditor.render();
  4.  
  5. //Inside an event handler after the Editor is rendered
  6. YAHOO.util.Event.on('somebutton', 'click', function() {
  7. //Put the HTML back into the text area
  8. myEditor.saveHTML();
  9.  
  10. //The var html will now have the contents of the textarea
  11. var [b]html [/b]= myEditor.get('element').value;
  12. });
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

Post Information

  • Total Posts in this topic: 1 post
  • Users browsing this forum: spork and 89 guests
  • 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
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.