Jump to content

var in a webpage(html form textarea VALUE - yui) that contains html code, and want to appear it, in confirmformpage.php


lse123

Recommended Posts

 var html = myEditor.get('element').value;   // you mean exactly below this line the---document.getElementById("hidden_id").value = html;

Assuming you also have a hidden input:<input type="hidden" id="hidden_id" name="hidden_name">somewhere inside your form, yes that will work.
Link to comment
Share on other sites

Assuming you also have a hidden input:<input type="hidden" id="hidden_id" name="hidden_name">somewhere inside your form, yes that will work.
what if contents of hidden field(html js var) is html & text, does it matters?
Link to comment
Share on other sites

what if contents of hidden field(html js var) is html & text, does it matters?
Probably not, but I guess it depends on what you mean by "text"You might want to escape your HTML before you place it in your hidden input, though. In your code, just before this line:document.getElementById("hidden_id").value = html;put this line:html = html.replace("<", "<");
Link to comment
Share on other sites

  • 2 weeks later...
http://developer.yahoo.com/yui/editor/#getdatathe below at above instructions^,....must be inserted plain or in submitForm() --> onsubmit="return submitForm();" ?what are the:'somebutton', 'element'...?
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;});

where insert the below...> inside event function or ?html = "<i>hjgjhgjhgbjhgjh nkjnkjnkj</i>"; // for testinghtml = html.replace("<", "<");document.getElementById("hiddenField").value = html;

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...