Why is textarea filled with mysterious white spaces?


I have a simple text area in a form like this:

<textarea style="width:350px; height:80px;" cols="42" rows="5" name="sitelink">
    <?php if($siteLink_val) echo $siteLink_val; ?> 

I keep getting extra white space in this textarea. When I tab into it my cursor is like in the middle of the textarea and not in the beginning? What is the explanation?

5/22/2017 8:12:01 AM

Accepted Answer

Look closely at your code. In it, there are already three line breaks, and a ton of white space before </textarea>. Remove those first so that there are no line breaks in between the tags any more. It might already do the trick.

2/4/2010 8:37:12 PM

Well, everything between <textarea> and </textarea> is used as the default value for your textarea box. There is some whitespace in your example there. Try to eliminate all of that.

Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow