Page 1 of 1

PHP TextArea Blank Space Problem!!!

Posted: Wed Jun 27, 2007 11:34 am
by kunalm
patrikG | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


Hello Gurus
                  I need a little bit of help here. I am using xamp with win xp prof sp2 as my devlopment environment. It works fine and gves me no trouble. But whenever I use a textarea tag with the following code, when I open the page which contains the form some blank spaces gets added to the text values which I display in the texarea tag(in case of editing a record). Or even when I open the blank form(to insert record), when I click or tab int the textarea control, the same problems causes me massive trouble.  

The code I am using is as follows:
Edit mode:
-------------
[syntax="php"]<textarea style="overflow:auto;font-family:Arial;font-size:12px;" name="cat_desc" rows="5" cols="50">
<?php echo "The value to display here..."; ?>
</textarea>
Insert mode:
----------------

Code: Select all

<textarea style="overflow:auto;font-family:Arial;font-size:12px;" name="cat_desc" rows="5" cols="50">
</textarea>
Any ideas why this is happenning? Please help me with something. I have been working on this but could not solve the problem on my own.

Thanks in advance for your help.[/b][/syntax]


patrikG | Please use[/syntax]

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]

Posted: Wed Jun 27, 2007 11:59 am
by smudge
Hi, I happened to run into this same problem before. In HTML, white space is generally ignored, but in textareas, it is not. Make sure there is no extra whitespace between your textarea tags, and that should solve the problem.

Posted: Wed Jun 27, 2007 1:46 pm
by RobertGonzalez
Try this:
Edit mode

Code: Select all

<textarea style="overflow:auto;font-family:Arial;font-size:12px;" name="cat_desc" rows="5" cols="50"><?php echo "The value to display here..."; ?></textarea>
Insert mode

Code: Select all

<textarea style="overflow:auto;font-family:Arial;font-size:12px;" name="cat_desc" rows="5" cols="50"></textarea> 

Posted: Thu Jun 28, 2007 12:28 am
by kunalm
Thank you all for the help. The code did helped a lot. :D