42 users online (1 members and 41 guests)  


  Results 1 to 4 of 4

Related

  1. reading data from the textarea type    Forum: ASP Forum
    Replies: 9
  2. Line breaks    Forum: CSS Forum
    Replies: 10
  3. Replies: 8
  4. reading from text file to textarea using vbscript    Forum: Website Scripts Forum
    Replies: 0
  1. #1
    sumitindelhi's Avatar
    New User

    Status
    Offline
    Join Date
    Aug 2004
    Posts
    1

    reading data line by line from textarea

    hi,
    i am designing a web page in which some data needs to put in a textarea. now, when i read the data from textarea using request.querystring("<textarea name>"), some form of formatting gets lost. line breaks, tabs, spaces, etc. are lost in the process. i need to save the data in the textarea as a file. so formatting needs to be saved. how do i get around with this problem.
    also, i wish to design a textarea like the one that comes when we post a reply. the textarea should provide for fonts, color, size change, bold, and other such features available on post reply page. how do i do that?
    please help.
    bye,
    sumit

  2. #2
    QuietDean's Avatar
    Administrator

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

    To make the line breaks show, you have to convert them to <br /> tags. Try:

    Code:
    Replace(request.querystring("<textarea name>"), chr(10), "<br />")
    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
    QuietDean's Avatar
    Administrator

    Status
    Offline
    Join Date
    Oct 2000
    Location
    Bournemouth, UK
    Posts
    2,662
    Oh, and your second question:

    You would first need to write a 'bbcode' system to parse certain tags. Then you can use JavaScript to make the textarea automatically do this.

    A simpler solution might be to use the fantastic http://www.interactivetools.com/products/htmlarea/ HTMLArea pre-made javascript. have a look at the link to see how it works.
    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?

  4. #4
    yashoda's Avatar
    New User

    Status
    Offline
    Join Date
    Oct 2008
    Posts
    2

    Re: reading data line by line from textarea

    hi quietdean,
    i tried using the below line to save textarea line by line. u wrote
    "Replace(request.querystring("<textarea name>"), chr(10), "<br />") "
    this is how i gave it
    Response.write((Request.form("blog")).Replace("\n","#")).
    it gives me this error "Object doesn't support this property or method "
    i basically want to access textarea line by line. can u pls tell me how to do it



Tags for this Thread