Hi

I was trying to echo a message from a textfield to a textarea. But everytime I do that, there's always a tab space in front of the message in the textarea. How can I get rid of this tab space?

Thank you very much.

regards,
sy_sean

    somehow or other you are adding the space in your code, as this isn't a function of PHP or MySQL. You might be adding the tab in code that downloads the text, or perhaps you are adding it when you save the text. You could prove the matter by checking the text through a db interface you haven't written, eg., PHPmyadmin.

    Are you sure it's a tab (chr(9) )?

      can you post here a piece of your code, that echoes this text int into a textarea?

        The code below will give you the extra space before the message in text area:

        <form name="form1" method="post" action="">
        <textarea name="textarea">
        <?php print $message; ?>
        </textarea>
        </form>
        

        but the one below will not.

        <form name="form1" method="post" action="">
        <textarea name="textarea"><?php print $message; ?></textarea>
        </form>
        
        

        can you see the difference? As simple as that. πŸ˜‰

          Hi nemonoman, mjr and scoppc,

          Thank you very much for your reply. I really appreciate it. I think scoppc has solved my problem. My code was originally like the first one that he gave.

          Thanks,
          sy_sean

            a month later

            scoppc!!!
            thanks!!!

            I had the same @%##@% sympton too...
            after reading ur posts...problem solved!!

            thanks againπŸ˜ƒ

              6 years later

              THANKYOU.....!

              7 years later I found this forum and solved the problem I have been mulling over for almost two weeks.

              I can'r believe it was so simple, particularly after tryint all kinds of functions to get rid of the dredded \t.

              P

                Write a Reply...