views:

87

answers:

2

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?

A: 

Put all of your attributes inside of quotes:

<textarea name="comment" cols="40" rows="6"></textarea><br><br>
Conspicuous Compiler
+1  A: 

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>
VoteyDisciple
huh... I just erased all the code from the text box and refreshed and it didn't come back. I guess it was some weird quirk that put it in there in the first place.
Malcolm
'rows' and 'cols' are required attributes in some DOCTYPEs
The Moof