Note that there are some explanatory texts on larger screens.

plurals
  1. POIndicate word wrap in textarea
    primarykey
    data
    text
    <p>I have textarea with rows="50" and cols="15". I want when it's going to wrap the words to simulate enter pressing,because I check when the user goes to new row with <strong>keydown and e.which==13</strong> ,but the word wrap prevents me to check this. <strong>edit</strong>: Because I want to try to make something like online editor ,and I dynamicly count the rows like Bespin`s(bespin.mozillalabs.com ,left) rows counting.For this counting I detect when enter is pressed and add new number,but when word wrap is on - it counts wrong ,because when the words are wrapping enter isn't pressed.</p> <p><strong>Edit 2</strong>: I found a script ,that does what I want ,but how to simulate enter pressing?</p> <pre><code>&lt;script language="javascript" type="text/javascript"&gt; var ijk = 0; function txt_ara() { //alert("1"); //alert(document.getElementById("email").value.length); //var ijk = 0; //var incr = 2; if(document.getElementById("email").value.length &lt;= 59) { if(document.getElementById("email").value.length == 59) { document.getElementById("email").value += "\n"; } } else { var lkm = ""; if(ijk == 0) { lkm = parseInt(document.getElementById("email").value.length % 120); } else { lkm = parseInt(document.getElementById("email").value.length % 60); } if(lkm == 0) { ijk = 1; document.getElementById("email").value += "\n"; } } } &lt;/script&gt; &lt;textarea name="email" id="email" class="txtField1" cols="60" rows="26" wrap="off" onkeyup="txt_ara();" onkeydown="txt_ara();"&gt;&lt;/textarea&gt; </code></pre>
    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