Help - Search - Members - Calendar
Full Version: Textarea Code is Effecting the Page
Forums > Resource Center > Webmasters' Corner > Webmasters' Corner Resolved Topics
CrimsonSkyGraphics
Hey everyone.

So, I've got a graphics and layout site. Finally did a div overlay MySpace layout, but had problems when I tried to add it to the site. :( Need some help.

I normally enter the layout code into textarea boxes on the page. This works fine, except with this one, it's changing the code and melding it into the page.

THe layout code ends in a custom comment box and submit button, followed by another div. Problem is that when I insert this into the text area, it adds the div and submit button below the textarea box and removes that part of the code from the textarea box. Grrr!

Can anyone help me stop it from doing this?

The problem part of the code is this:
CODE
<div style="text-align:center;">
<form method="post" action="index.cfm?fuseaction=user.viewProfile_commentForm&friendID=XXXXXXXXX">
<textarea name="commentText" class="commentBox">Let me know what you're thinking here...</textarea><br />
<input type="submit" name="commentformbutton" class="button" value="Send Your Comment" /></form>
</div> <br />
</div>

<div class="crimsonskygraphics">
<a href="[url="http://www.crimsonskygraphics.com"]http://www.crimsonskygraphics.com[/url]" class="credit"></a>
</div>


From the last period after "Let me know what you're thinking here..." to the end disappear and become part of the page, with an actual working button below the textarea.

This is the actual page code where the problem arises:
CODE
<div style="text-align:center;">
<form method="post" action="index.cfm?fuseaction=user.viewProfile_commentForm&friendID=XXXXXXXXX">
<textarea name="commentText" class="commentBox">Let me know what you're thinking here...</textarea><br />
<input type="submit" name="commentformbutton" class="button" value="Send Your Comment" /></form>
</div> <br />
</div>

<div class="crimsonskygraphics">
<a href="[url="http://www.crimsonskygraphics.com"]http://www.crimsonskygraphics.com[/url]" class="credit"></a>
</div>textarea><br />
&nbsp;</div><br />
</div>


And here's a picture of what it's doing:



jiyong
The problem is that you cannot nest <textarea> tags inside <textarea> tags.

There are two methods I use to solve this:

1. Use <code> tags to hold layout codes instead of <textarea> tags and format using CSS
2. In your HTML, replace the carrots < > with &lt; &gt; in the textarea tags in your layout code.
Instead of
CODE
<textarea name="commentText" class="commentBox">Let me know what you're thinking here...</textarea><br />

use
CODE
&lt;textarea name="commentText" class="commentBox"&gt;Let me know what you're thinking here...&lt;/textarea&gt;<br />
CrimsonSkyGraphics
YAY! Number 2 works absolutely perfectly by the looks of it. Thank you SO much! You're a life-saver. ^_^
manny-the-dino
Topic Closed and Moved
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.