Jump to content


Photo

textarea formatting


  • Please log in to reply
2 replies to this topic

#1 natalieG

natalieG
  • Members
  • PipPipPip
  • Advanced Member
  • 63 posts

Posted 18 June 2006 - 09:50 PM

we use the below line in a form to initialize a textarea with $NOTE which is the gotten from a database query in mysql. the first line is indented about 1/2 the textarea width. all other lines are fine. As far as we know, there are no tabs or other formatting characters in the textarea.

we tried to use echo trim($NOTE) but that does not solve the issue. the contents of the
field is not indented. we get the value by $NOTE=$ROW[NOTE};

[!--coloro:#FF6666--][span style=\"color:#FF6666\"][!--/coloro--]<tr><td width="664" COLSPAN="2"><textarea name="NOTE" rows="20" cols="85" tabindex="1"> <?php echo $NOTE;?></textarea></td>[!--colorc--][/span][!--/colorc--]

We tried the php forum, but dod nopt got what we expected, so perhaps it is an html issue.

Thanks,

Jennifer

#2 bobleny

bobleny
  • Members
  • PipPipPip
  • Advanced Member
  • 429 posts

Posted 18 June 2006 - 10:03 PM

Umm, try replacing "<?php echo $NOTE;?>" with a literal. Take the literal text from $NOTE and place it there and see if you get the same results.
-- www.firemelt.net --
First do me a favor and read this: JavaScript is NOT Java - Then read this: www.php.net - When your done with that, read this Topic
After that, floors open. I and anyone else will be MORE than happy to answer YOUR query! [Topic Solved]
Cheer up, the worst has yet to come...

#3 bobleny

bobleny
  • Members
  • PipPipPip
  • Advanced Member
  • 429 posts

Posted 18 June 2006 - 10:48 PM

I've been working on creating a PHP forum and I just added my edit post featuer to it. The code for a specific spot goes like this...

                <textarea name="message" cols="70" rows="15" wrap="soft" maxlength="500">
                    <?php echo $_POST['message']; ?>
                </textarea>

When I tested it I found that I had a huge space infront of my message. Sound familliare? Its because I have 5 tabs after the opening <textarea> tag and it traslated over to the inside of my box. I got rid of the spaces and it works fine now.

Do you have any space? eg.
<textarea attributes=""> {white space or an enter} </textarea>

-- www.firemelt.net --
First do me a favor and read this: JavaScript is NOT Java - Then read this: www.php.net - When your done with that, read this Topic
After that, floors open. I and anyone else will be MORE than happy to answer YOUR query! [Topic Solved]
Cheer up, the worst has yet to come...




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users