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 7194115
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T20:18:23+00:00 2026-05-28T20:18:23+00:00

<tr> <td> <b>Escalation: </td></b> <td> <TextArea name=’escalation’ onKeyDown=\limitText(this.form.escalation,this.form.countdown,100);\ onKeyUp=\limitText(this.form.escalation,this.form.countdown,100);\>$Text</textarea>You have <input readonly type=\text\ name=\countdown\

  • 0
<tr>
    <td>
        <b>Escalation: 
    </td></b>
    <td>
        <TextArea name='escalation' onKeyDown=\"limitText(this.form.escalation,this.form.countdown,100);\"     
onKeyUp=\"limitText(this.form.escalation,this.form.countdown,100);\">$Text</textarea>You have <input readonly type=\"text\" name=\"countdown\" size=\"3\" value=\"100\"> characters left.
    </td>
</tr>

That is a excerpt of the code im trying to use. Basically I’m trying to fill the text area with a value stored in a php variable, which comes from a SQL database. the Javascript functions limit the amount of text in a block to 100 Chars.

Problem is that it fills whatever space isnt used in the initial value with spaces! I printed the $Text between two quotes so I would know for a fact it doesnt have spaces in the database, which it doesnt. You can also clearly see that I dont have any space at all between the textarea tags so that isnt the issue that I see other posters have.

Any ideas?

  • 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-05-28T20:18:23+00:00Added an answer on May 28, 2026 at 8:18 pm

    Yes, I have seen that behavior before. Check to see if the column that you are reading the value from in the database is of type “CHAR” or type “VARCHAR”. It is more efficient to always use fixed-length (CHAR) over variable-length (VARCHAR) field types, so databases are sometimes designed that way. The down side is that shorter data stored in those fields is always padded with spaces.

    The solution: You probably have a line in your PHP that looks something like this:

    $Text = $row['text'];
    

    Change that line to the following:

    $Text = trim($row['text']);
    

    The ‘trim’ function will strip leading and trailing spaces. If you are using fixed length fields, remember that you will HAVE TO pad the values that you write to the database as well. That means that you will have to add leading spaces to the string to be written to the database to make the then proper length for fixed-width field.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have seen many articles and Questions/Answers Regarding Lock Escalation but following things are
I have this ugly select list with indents (-) to illustrate hierarchy. I would
We have an issue with some deadlock and I posted this question . With
I have been dealing with this for at least two days now. I don't
I'm trying to order an array of results using a rating forumula I have
My query always produces duplicate results. How best do I go about troubleshooting this
My company is looking at various PHP frameworks to build a customer's site. This
I have a deadlock problem with two transactions that do not access any common
I am completing a text based game for an intro to python class. It
I have read a lot about preventing race conditions, but typically with one record

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.