Note that there are some explanatory texts on larger screens.

plurals
  1. POJavascript: Problem with switching between html textarea and nicedit
    primarykey
    data
    text
    <p>I am using nicedit (http://nicedit.com/index.php).</p> <p>I have been trying to create a default html textarea that gets turned into a nicedit textfield when you click on it. I want it to revert to a plain html textarea when it loses focus. I have been able to do this successfully when using just one textarea, however, when I use two textareas strange things happen (in firefox). I use the following script:</p> <pre><code>&lt;script type="text/javascript" src="http://js.nicedit.com/nicEdit-latest.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; function fieldname_1() { area = new nicEditor({fullPanel : true}).panelInstance('fieldname'); area.addEvent('blur', function() { area.removeInstance('fieldname'); area = null; document.getElementById("fieldname").onclick=function(){fieldname_2()} }); } function fieldname_2() { area = new nicEditor({fullPanel : true}).panelInstance('fieldname'); area.addEvent('blur', function() { area.removeInstance('fieldname'); area = null; document.getElementById("fieldname").onclick=function(){fieldname_1()} }); } function fieldname2_1() { area = new nicEditor({fullPanel : true}).panelInstance('fieldname2'); area.addEvent('blur', function() { area.removeInstance('fieldname2'); area = null; document.getElementById("fieldname2").onclick=function(){fieldname2_2()} }); } function fieldname2_2() { area = new nicEditor({fullPanel : true}).panelInstance('fieldname2'); area.addEvent('blur', function() { area.removeInstance('fieldname2'); area = null; document.getElementById("fieldname2").onclick=function(){fieldname2_1()} }); } &lt;/script&gt; &lt;TEXTAREA id="fieldname" cols="35" onclick="fieldname_1();" &gt;&lt;/TEXTAREA&gt; &lt;br&gt;&lt;br&gt;&lt;br&gt; &lt;TEXTAREA id="fieldname2" cols="35" onclick="fieldname2_1();" &gt;Test text&lt;/TEXTAREA&gt; </code></pre> <p>The first textarea you click and unfocus from works perfectly, however, the second textarea you click will not dissappear when trying to unfocus. What am I doing wrong?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload