473,404 Members | 2,137 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

textarea adds unwanted spaces

Expand|Select|Wrap|Line Numbers
  1. <TEXTAREA NAME="comments" ROWS="10" COLS="50">
  2.         <?php  echo $comments; ?>
  3. </TEXTAREA>
  4.  
  5. this is a very simple question. the textarea above automatically adds three tab spaces at the beginning. as a result, when i try to check it using javascript
  6.  
  7.  if(theform.comments.value == "")
  8.      {
  9.            //some code here
  10.      }
  11.  
it never becomes null even if no input has been made. i know this is a very simple question but i can't really figure out what's wrong.

Please enclose any code within the proper code tags. See the Posting Guidelines on how to do that. - moderator
Mar 2 '08 #1
2 3333
dlite922
1,584 Expert 1GB
try this:
[PHP]
<TEXTAREA NAME="comments" ROWS="10" COLS="50"><?php echo $comments; ?></TEXTAREA>
[/PHP]

no spaces between <textarea></textarea>
Mar 2 '08 #2
try this:
[PHP]
<TEXTAREA NAME="comments" ROWS="10" COLS="50"><?php echo $comments; ?></TEXTAREA>
[/PHP]

no spaces between <textarea></textarea>
hi, i figured this out too a while a go. it turned out the i coded the ff:
<texarea>
<?php echo $comments; ?>
</textarea>

so, that explained the spaces. thanks for the reply
Mar 2 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Gadrin77 | last post by:
I noticed when displaying the contents of a CDATA node inside a TEXTAREA using MSXML and XSL, I get an extra space before the data. at first I thought I hadn't "tightened up" the XSL, but then...
15
by: Jeff North | last post by:
Hi, I'm using a control called HTMLArea which allows a person to enter text and converts the format instructions to html tags. Most of my users know nothing about html so this is perfect for my...
0
by: Doug Baroter | last post by:
Hi, Here's the problem I want to solve. Suppose you design an HTML FORM with three elements of INPUT, TEXTAREA AND SUBMIT, you specify the length for the INPUT box as Size="30" and MaxLen="50",...
5
by: Jesper Rønn-Jensen | last post by:
I have a textarea that must be limited to 70 characters. No big deal -- at least so I thought. * Textarea must not exceed 70 characters * Exceeding content must be cut off * Must work on input by...
4
by: rukkie | last post by:
After a redisplay of the form, caused by errors in other fields, the text which is in the "Observ" textarea is shifted (some 8 places) to the right (and this each time after a redisplay). The code...
10
by: Adrian Smith | last post by:
This may be more a cgi thing than a Python one, but I'm trying to get this page: http://adrian10.phpwebhosting.com/trial.html consisting basically of this: <FORM...
3
by: FunkHouse9 | last post by:
I'm working on a form to collect data in a textarea which and am trying to keep returns and spaces. I have a couple of functions that I Frankensteined together to replace returns with <br> and to...
2
by: Khushbu84 | last post by:
Hello, I am having a problem to display my text in the beginning of the Textarea. For some reason It just keeps some spaces and then starts displaying. I am trying to display answers of selected...
7
by: Totti | last post by:
Hi all, I am a newbie to javascript learning it for 2 months now, i am trying to make a sorter who will read english words from the one tex area or data file and show the result in the 2nd text...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.