Strange Output: No Wrapping

What would cause output to extend past a TextArea??

Here is a screen-shot…

And here is my very basic HTML…


	<!-- Comment -->
	<li>
		<label for="comments">Comments:</label>
		<textarea id="comments" name="comments" cols="50" rows="15"><?php echo (isset ($comments) ? str2htmlentities(nl2br($comments)) : ''); ?></textarea>

		<?php
			if (!empty($errors['comments'])){
				echo '<br /><span class="error">' . $errors['comments'] . '</span>';
			}
		?>
	</li>

I am pretty sure this was working before, and now it is freaking out?! :shifty:

Debbie

There are no words in English that are that long, so far as I know (although I’m sure the Welsh could come up with something. :lol: ) Individual words don’t wrap unless you use some CSS3:

word-wrap:break-word;

Why did what I typed in break where it did?

Are the M’s I typed in the Form spilling out of the Form because in the outputted form they are wider?

Individual words don’t wrap unless you use some CSS3:

word-wrap:break-word;

Where would I put that code in my Styles to make it do whatever it is supposed to do?

Debbie

What did you actually type?

Are the M’s I typed in the Form spilling out of the Form because in the outputted form they are wider?

I’m not sure what you are asking. Maybe I’m misunderstanding the issue. It looks like you types a long string of m’s and then a break character, but I may be misunderstanding what’s happening here totally. Anyhow, why would you ever type a long string of m’s lke that?No word is that long.

Where would I put that code in my Styles to make it do whatever it is supposed to do?

I suppose

textarea {word-wrap:break-word;}

but I’m not totally sure. Give it a try and see if it works.

Hi Debbie,

Can we see the relevant code from “View Source” as I don’t understand the output you are getting. Normally you can’t stop a textarea from wrapping even with unbroken content.

Your screenshot doesn’t look like a textarea element.

If its just a normal div then use the code that Ralph suggested on the div.

Ralph & Paul,

This is topic is actually much more involved than what I originally posted.

The problem is that I have two PHP functions that add/remove HTML for security purposes, and things seems to not be working right. (I’m not sure that I can have it both ways like I need?!)

Give me some time to research this topic some more, and then I can come back and give you more info to see if you can help. I am thinking this is more of a coding issue with PHP than anything… :-/

Thanks,

Debbie