SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Wizard DoubleDee's Avatar
    Join Date
    Aug 2010
    Location
    Arizona
    Posts
    3,530
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Strange Output: No Wrapping

    What would cause output to extend past a TextArea??

    Here is a screen-shot...
    Attachment 60109


    And here is my very basic HTML...
    HTML Code:
    	<!-- 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?!


    Debbie

  2. #2
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    23,598
    Mentioned
    411 Post(s)
    Tagged
    6 Thread(s)
    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. ) Individual words don't wrap unless you use some CSS3:

    Code:
    word-wrap:break-word;

  3. #3
    SitePoint Wizard DoubleDee's Avatar
    Join Date
    Aug 2010
    Location
    Arizona
    Posts
    3,530
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by ralph.m View Post
    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. )
    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:

    Code:
    word-wrap:break-word;

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


    Debbie

  4. #4
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    23,598
    Mentioned
    411 Post(s)
    Tagged
    6 Thread(s)
    Quote Originally Posted by DoubleDee View Post
    Why did what I typed in break where it did?
    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

    Code:
    textarea {word-wrap:break-word;}
    but I'm not totally sure. Give it a try and see if it works.

  5. #5
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    39,802
    Mentioned
    158 Post(s)
    Tagged
    4 Thread(s)
    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.

  6. #6
    SitePoint Wizard DoubleDee's Avatar
    Join Date
    Aug 2010
    Location
    Arizona
    Posts
    3,530
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Paul O'B View Post
    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


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •