0

I have my TextEdit application on Plain Text mode. Then from Plain Text mode I copy and pasted some text from my TextEdit app into an html form's textArea. In the TextArea, all my multiple spaces are shrunk. Does anyone know how to tell the textArea to not shrink my multiple spaces?

The TextArea is simply

Documentation:<br/><textarea name="documentation" rows="8" cols="80"></textarea><br/>

CLARIFICATION

There seems to have some confusion so let me try to clarify. The problem is the TextArea in the form. I am moving text as TextEdit -> TextArea -> X, where by X I mean a display that will present the text to viewers exactly as it was displayed in the TextArea (i.e. the display uses <body><pre...>...</pre></body>). You can imagine a chat app if you will.

Here is what's weird: the text is nicely formatted in EditText (text editor). But when I paste into the TextArea the text formatting is broken. If I recopy from the TextArea back into the Text Editor, the text looks "normal" again. So the question: How do I get the TextArea to display text exactly as it was pasted from a plaintext text editor? Since there is no RichText involved, I figure I don't have to do the heavy lifting of using a WYSIWYG editor (I am very new to html).

UPDATE

As I troubleshoot I find the root cause: TextArea, it turns out, is RichText. So will someone please show me how to submit my form specifying that the data should be plainText? I am reading about a jQuery function but I don't understand how to apply it prior to submitting the form (the form has many fields, some of which are TextAreas)

Here the jQuery I speak of

var my_plaintext = $(the_richtext).text();
Katedral Pillon
  • 14,534
  • 25
  • 99
  • 199

1 Answers1

0

If I am reading this correctly it is genuinely a bad idea to use multiple spaces for formatting, but if you need this then have a look at non breaking spaces

&nbsp

This will add and keep the space.

David Cusack
  • 146
  • 3
  • Thanks for replying. But maybe you are not reading it correctly. Imagine you need to fill a form. The form has a TextArea. Now when you copy some text from a plaintext Text Editor into the form, the form removes some of the spaces arbitrarily so that the formatting of the text on the Form is broken – Katedral Pillon Jul 02 '16 at 19:29