Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7827077
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T09:42:45+00:00 2026-06-02T09:42:45+00:00

I would like to remove the initial space in a textarea. When there is

  • 0

I would like to remove the initial space in a textarea. When there is no text given to a textarea and you get the textarea.value, you get a single space ” ” instead of the empty string like a normal input textbox.
Also when there is text (i.e. test) it returns ” test”. Is it possible to prevent this extra space?
I would prefer to work with the prototype of Textarea because I am using a general procedure to get the values of both input textboxes and textarea’s.

For the moment I wrote something like this:

Textarea.prototype.value = function() {
        var val = this.value;
        if (val[0] == "0") val.splice(0,1);
        return val;
    };   

But it doesn’t solve the problem, I still get the extra space.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T09:42:47+00:00Added an answer on June 2, 2026 at 9:42 am

    Your HTML should be like this:

    <textarea></textarea>
    ---------^ no space, tab or new line there 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to remove all occurrences of a given value from within a
I would like to remove a trailing slash from a string. For example if
I would like to remove multiple spaces in a file with a single character.
I would like to remove some warnings for some classes by generating an automatic
I would like to remove border on a gtk.Button and also set its size
I would like to remove an old JPanel from the Window (JFrame) and add
I would like to remove/uninstall directX End-User that I downloaded and installed it from
I would like to remove a key from a STL map. However, map.erase() doesn't
I have a UITableViewCellAccessoryDisclosureIndicator that I would like to remove in an if statment..
I have a sample dataform and I would like to remove the ability to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.