Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Instead of trying to derive your lines after the fact, you're probably better off putting in markers before you send the data to be tested. <a href="https://stackoverflow.com/questions/4719777/finding-line-breaks-in-textarea-that-is-word-wrapping-arabic-text">finding &quot;line-breaks&quot; in textarea that is word-wrapping ARABIC text</a> looks like it has a pretty robust technique for forcing line breaks at all line wraps. If the line breaks used by the textarea and the lien breaks used by the file are not the same, you should still find it relatively easy to convert from one to the other in transit. If you don't want to perturb it because you want the user to be able to edit it without the additional line breaks if/when it comes back invalid, then I'd suggest cloning the textarea to a space inside a "display:none" div or equivalent setup. Mangle and test the clone as appropriate, and then put the feedback on the untouched visible original. If the file has an autowrap width, then you'll have to make sure that the autowrap width of the textarea is shorter, but that shoudln't be difficult, and I'd be a bit surprised if it was an issue to begin with.</p> <p>Edit: if the python module has to have quotes before the break-line, you're in a bit of trouble anyway - anyone can put in hard break-lines manually at any time just by hitting enter. My suggestion there would be to have some sort of processor function in between the Json and the file that went and put appropriate quotes just before line breaks - although I may be misunderstanding things a bit here.</p> <p>If you want multiple copies of your form to play with, though, that's totally doable. You do need to use jQuery, but jQuery is worth learning anyway. (It's somewhat frustrating until you figure it out, and then after you figure it out it's the best thing that ever happened to javascript and you'll never want to be without it.) Include the most recent copy of jQuery (it's a javascript plugin). The <code>clone()</code> function will let you create an exact duplicate of your existing textarea (or form, or any other DOM object, really) at time of cloning (ie, it'll have all the text written into it). The <code>insertBefore()</code> and/or <code>insertAfter()</code> functions will let you put it anywhere in the page you want - perhaps inside a <code>&lt;div style="display:none"&gt;&lt;/div&gt;</code> so that you can muck around with it as much as you like without doing anything visible on the screen. </p>
    singulars
    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.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      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