Jump to content

[SOLVED] textarea already has characters


alex3

Recommended Posts

Hi,

 

I'm trying to get this form working perfectly, but whenever the page is loaded, the textarea field already has 'invisible characters' in it. Clicking in the field, and you'll see the blinking cursor isn't at the beginning of it.

 

This occurs on IE7 and 8, Chrome and Safari and Firefox 3 on OS X. Those are what I've tested the site on anyway!

 

Cheers

Link to comment
https://forums.phpfreaks.com/topic/162607-solved-textarea-already-has-characters/
Share on other sites

I didn't test it... but if you remove the whitespace, does it fix it?

			<li>
			<label for="message">Message</label><br>
			<textarea name="message" id="message">
							</textarea>

						</li>

--> to

			<li>
			<label for="message">Message</label><br>
			<textarea name="message" id="message"></textarea>
		</li>

Ah, of course it does!

 

In my code I had

 

<textarea name="message" id="message">
<? somephp ?>
</textarea>

 

So of course once the PHP had been parsed, a big gap was left. Put it all in one line; no more problem.

 

Gah, such a silly little oversight. Thanks a lot for pointing it out :)

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.