473,407 Members | 2,326 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,407 software developers and data experts.

Problem with textarea

25
Hello friends,
I am having hard time working with text area on my html form. I dont know why but i am getting some extra space on my text area. So becuase of this reasom i am also not able to validate the empty text field. THere is nothing wrong with the code but i dont know why the text area is talking extra space inside of it when form loads
My code was initially like this [HTML] <textarea cols="55" rows="20" name="user_name"> [/HTML]

Then after reading some problem related to it in different web forum i added some extra lines of code for text box. But still the problem exists .. I am not sure what did i di wrong. [HTML] <textarea cols="55" rows="20" name="faculty_name" style="margin-top: -1px; margin-bottom: -1px; margin-left: -1px; margin-right:-1px;">
</textarea> [/HTML]

P.S : I have few php script in this page too . But i dont think it has to do anything with this text area.

ANy thoughts or ideas would be highly appreciated.
Thanks
Feb 17 '07 #1
4 2566
AricC
1,892 Expert 1GB
That is a pretty big text area are you sure it is extra space? Also, if your trying to validate most of the time you want to use Trim() in what ever language your validating with to get rid of excess spaces.

Aric
Feb 17 '07 #2
arizal
25
I want to use a Javascript validation . But my current javascript does not checks for whitespace when i give parameters like input.text=="" or null.
I have no idea how to solve this. Does any one have any idea to fix this..
Thanks
Feb 18 '07 #3
AricC
1,892 Expert 1GB
I want to use a Javascript validation . But my current javascript does not checks for whitespace when i give parameters like input.text=="" or null.
I have no idea how to solve this. Does any one have any idea to fix this..
Thanks
Try:
Expand|Select|Wrap|Line Numbers
  1. function TrimString(str) {
  2. str = str.replace(/^[ ]+(.*)$/, ‘$1′); // Trims leading spaces
  3. str = str.replace(/^(.*)[ ]+$/, ‘$1′); // Trims trailing spaces
  4. return str;
  5. }
  6.  
To trim the text box.


Aric
Feb 18 '07 #4
arizal
25
Thanks Aric ,
i will try that and see if that helps
Feb 19 '07 #5

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

Similar topics

1
by: Veverita | last post by:
Hi there I'm hoping that someone can help me with a question I have about javascript syntax. I got an html page that uploads an image and some text field to a database. What I'd like to do...
3
by: Tyrone Slothrop | last post by:
The first question, is this even possible? What I need to do is pass the contents of a PHP web page from a textarea using window.open method to a new browser window and display it. The page has...
9
by: Paul Gorodyansky | last post by:
Hi, FAQ tells how to insert (or replace0 a text at a caret position in Mozilla (and same works for Opera 8+), for example, at http://www.faqts.com/knowledge_base/view.phtml/aid/1661 it talks...
3
by: arashamiri | last post by:
Hi, I wrote an auto resizing textarea: function myMax(anumber, another) { if (anumber > another) { return anumber; } return another; }
2
by: ctiggerf | last post by:
I am having a regular expression problem with a bit of code I'm working on. I was able to get a similar piece of code working in perl, but now I'm trying to convert it over. Basically what I'm...
0
by: .nu | last post by:
#!/usr/bin/env python # -*- coding: utf-8 -*- # Name: Sleepy Hollow # Author: .nu import wx import os import sys
8
by: Chris | last post by:
Hi, i have in an content page a fieldset containing a label, an iframe and a textarea: <asp:Content ID="Content1" ContentPlaceHolderID="main" Runat="Server"> <fieldset style="width:650px;">...
3
by: saytri | last post by:
I am displaying the contents of a textfile in a textArea. I want that when i edit this text in the textArea it is automatically saved in the textfile. I have wriitten this code, but the problem is...
0
by: saytri | last post by:
Im trying to sort a set of names, stored in a textfile in acscending order (this textfile contains also the marks of each student). I did this piece of code, but altough its compiling its not sorting...
2
by: swethak | last post by:
Hi, I am getting the problem the problem with google map in Internet Explorer. This map worked fine in mozilla . When i opened the same map in Internet Explorer i am getting the error...
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
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...

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.