arunpatal Posted November 28, 2013 Share Posted November 28, 2013 Is there is a way that javascript rich textarea doesn't escape < and > ???? Link to comment https://forums.phpfreaks.com/topic/284360-javascript-textarea-escape-and/ Share on other sites More sharing options...
.josh Posted November 28, 2013 Share Posted November 28, 2013 please provide code example of what you mean Link to comment https://forums.phpfreaks.com/topic/284360-javascript-textarea-escape-and/#findComment-1460519 Share on other sites More sharing options...
arunpatal Posted November 29, 2013 Author Share Posted November 29, 2013 <script> function iFrameOn(){ richTextField.document.designMode = 'On'; } function iBold(){ richTextField.document.execCommand('bold',false,null); } function iUnderline(){ richTextField.document.execCommand('underline',false,null); } function submit_form(){ var theForm = document.getElementById("myform"); theForm.elements["myTextArea"].value = window.frames['richTextField'].document.body.innerHTML; theForm.submit(); } function createDiv() { var divTag = document.createElement('div',false,null); divTag.id = "div1"; divTag.style.border = "1px solid #333"; divTag.className = "dynamicDiv"; divTag.innerHTML = "This HTML Div tag created " + "using Javascript DOM dynamically."; window.frames['richTextField'].document.body.appendChild(divTag); } </script> <body onLoad="iFrameOn();"> <table><td width="100%" valign="top"> <h2>My web application that intakes data from users</h2> <form action="richtext.php" name="myform" id="myform" method="post"> <div id="wysiwyg_cp" style="padding:8px; width:700px;"> <input type="button" onClick="iBold()" value="B"> <input type="button" onClick="iUnderline()" value="U"> <input id="btn1" type="button" value="create div" onClick="createDiv();" /> </div> <textarea style="display:none;" name="myTextArea" id="myTextArea" cols="100" rows="14"> </textarea> <iframe name="richTextField" id="richTextField" value="11" style="border:#000000 1px solid; width:700px; height:300px;"> </iframe> <br /><br /><input name="myBtn" type="button" value="Submit Data" onClick="javascript:submit_form();"/> </form> </td> </table> I want that when javascript ['richTextField'] pass value to ["myTextArea"].... It dosent change < and > to < and >...... can i make a array where i write words & these word will exchange with another word (or another array) and then ['richTextField'] pass value to ["myTextArea"]. with array i mean somthing like this replace('<', '<').replace('>', '>') Link to comment https://forums.phpfreaks.com/topic/284360-javascript-textarea-escape-and/#findComment-1460605 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.