Malcolm
Malcolm

Reputation: 11

How do I keep <textarea> from displaying raw html?

I'm working on the comment leaving system on my blog and everything works fine except I can't get my "comments" text box to become larger. Well, I can, using the command, but it puts the raw html from the rest of the page in the text box. The page displays my form as "Name: [blank input box] Comment: [larger input box, but filled with all the html on the page that follows ]". Here's my HTML form:

<div id="form">
<form action="comments.php" method="post">

<label for="name">Name</label>
<input id="name" name="name" type="text" />
<label for="comment">Comment</label>
<textarea name="comment" cols=40 rows=6></textarea><br><br>

<input type="Submit" value="Post Comment" />
</form>
</div>

What can I do to keep the 40 cols and 6 rows sized input box but stop it from displaying all the raw html that follows it in the input field?

Upvotes: 0

Views: 1791

Answers (2)

VoteyDisciple
VoteyDisciple

Reputation: 37803

There's nothing wrong with that HTML. Are you sure there isn't anything else on the page?

One thing to change: make sure you have cols="40" rows="6" (use quote marks around all attribute values).

You might also consider using a style instead:

<textarea name="comment" style="width: 400px; height: 100px;"></textarea>

Upvotes: 1

Conspicuous Compiler
Conspicuous Compiler

Reputation: 6469

Put all of your attributes inside of quotes:

<textarea name="comment" cols="40" rows="6"></textarea><br><br>

Upvotes: 0

Related Questions