50 users online (0 members and 50 guests)  


  Results 1 to 10 of 10

Related

  1. reading data line by line from textarea    Forum: ASP Forum
    Replies: 3
  2. Replies: 2
  3. reading from text file to textarea using vbscript    Forum: Website Scripts Forum
    Replies: 0
  1. #1
    Munk's Avatar
    New User

    Status
    Offline
    Join Date
    Jan 2003
    Posts
    4

    Unhappy reading data from the textarea type

    First off, I'd like to say this is a great site. Only a short time here and I'm loving it!

    Here's my question, and maybe it's better off located in a different type of area, but here goes...

    I have forms in which I use the TEXTAREA type, and the submission is read and processed to a DB by an ASP page with VBScript. The data that's entered via the TEXTAREA works just fine in the DB, but everytime the data is loaded into the TEXTAREA box in the editor, it throws extra spaces before and after the actual data. Usually around 6 spaces in front of the data, and 4 at the end. It keeps doing this whenever the page is loaded, so if I simply refresh the page holding the form, it will add an additional 4 spaces at the end every time. Like I said, the actual data posts to the DB without them, as I've checked that. I would really like the data to actually start at the beginning of the TEXTAREA box, though, and not keep adding the spaces at the end, as eventually the scroll bar shows that the box is forever long. Is there a simple answer to this??? :::: crosses fingers::::

  2. #2
    QuietDean's Avatar
    Administrator

    Status
    Offline
    Join Date
    Oct 2000
    Location
    Bournemouth, UK
    Posts
    2,662
    Hi there, welcome to the forums.

    There is an asp function called trim -

    Code:
    trimmedString = trim(stringWithSpaces)
    That should do it.
    If one of our members helps you, please click the icon to add to their reputation!
    No support via email or private message - use the forums!
    Before you ask, have you Searched?

  3. #3
    Munk's Avatar
    New User

    Status
    Offline
    Join Date
    Jan 2003
    Posts
    4
    Thank you for your response, and getting this trouble in the right location Interestingly enough, I've already implemented the 'Trim' function, but yet the problem remains. The data is getting trimmed great before being stored in the DB. It just persists on getting bumped over 6 spaces in the TEXTAREA box, plus having an extra 4 spaces at the end of it. When the page loads that contains the form, the value of the TEXTAREA is also being loaded via a query, and I've included the 'Trim' on that assignment as well. This problem truly baffles me. I'm not doing anything special with the TEXTAREA, and is very basic as follows:
    <code>

    <TEXTAREA name="chargrep" rows=3 cols=40>
    <%= strCharGRep%>
    </TEXTAREA>

    </code>

    I really do appreciate any help with this one... as it's not necessarily a function problem as much as a visual nuiscance

  4. #4
    QuietDean's Avatar
    Administrator

    Status
    Offline
    Join Date
    Oct 2000
    Location
    Bournemouth, UK
    Posts
    2,662
    Okay, need to know -

    what database are you using?
    What browser are you using?
    If one of our members helps you, please click the icon to add to their reputation!
    No support via email or private message - use the forums!
    Before you ask, have you Searched?

  5. #5
    QuietDean's Avatar
    Administrator

    Status
    Offline
    Join Date
    Oct 2000
    Location
    Bournemouth, UK
    Posts
    2,662
    Oh , and try -

    Code:
    <TEXTAREA name="chargrep" rows=3 cols=40><%= strCharGRep%> </TEXTAREA>
    you never know.
    If one of our members helps you, please click the icon to add to their reputation!
    No support via email or private message - use the forums!
    Before you ask, have you Searched?

  6. #6
    Munk's Avatar
    New User

    Status
    Offline
    Join Date
    Jan 2003
    Posts
    4
    The database is powered by Access 2000, and I'm running IE 6.0.2800, on a Windows 2000 Advanced Server box....

  7. #7
    Munk's Avatar
    New User

    Status
    Offline
    Join Date
    Jan 2003
    Posts
    4
    Hey, how about that? Putting it all on one line has fixed it!

    Who would'a thunk it? LOL Thanks again, QuietDean! Can't tell you how much this will help, as I hate those little things that take away from a good looking page

  8. #8
    QuietDean's Avatar
    Administrator

    Status
    Offline
    Join Date
    Oct 2000
    Location
    Bournemouth, UK
    Posts
    2,662
    Cool.one to remember
    If one of our members helps you, please click the icon to add to their reputation!
    No support via email or private message - use the forums!
    Before you ask, have you Searched?

  9. #9
    benzden's Avatar
    Senior Member

    Status
    Offline
    Join Date
    Feb 2002
    Location
    San Antonio, Texas
    Posts
    652
    Yes, what's not seen when editing one's code is oftentimes the problem - probably due to the invisible CHR$10 and CHR$13 (and others) added to text lines by the editor but not seen by the user unless via binary dump.

    When I can remember it, placing everything on one line oftentimes fixes otherwise insoluble problems.

  10. #10
    yashoda's Avatar
    New User

    Status
    Offline
    Join Date
    Oct 2008
    Posts
    2

    Re: reading data from the textarea type

    i want to store data line by line from a text area using javascript in asp.
    can u please tell me how to do it



Tags for this Thread