Retaining format for text extracted from <TEXTAREA>

Results 1 to 5 of 5

Thread: Retaining format for text extracted from <TEXTAREA>

  1. #1
    John Holliday Guest

    Default Retaining format for text extracted from <TEXTAREA>

    How does one retain the format of the text that was entered into a textarea? I am working on this guest book project and it is pretty much complete, except that when the data in the textarea is passed to an ASP page, it loses all the carriage-returns and paragraph spaces. I have thought of asking the visitors to insert HTML tags (<BR>, &#060;p>, etc), but that would be tacky and chances are most visitors would have no clue what an HTML tag is. How do online forums such as this one accomplish this? Any help is greatly appreciated.<BR><BR>Thanks,<BR><BR>John HollidaJHH

  2. #2
    Stephen Fisher Guest

    Default RE: Retaining format for text extracted from <TEXTAREA>

    Replace (chr(13), "<BR>")<BR><BR>Something along these lines is what you have to do. THe problem is when you go to edit it again you have to go the other way if you dont want the HTML code to show. replace("<BR>", chr(13))<BR><BR>Note: I&#039m not sure if it is chr(13) or chr(10)

  3. #3
    Chris Willey Guest

    Default RE: Retaining format for text extracted from <TEXTAREA>

    Try:<BR><BR>myString = Replace(Request.QueryString("field"), chr(13), "&#060;p>")<BR><BR>Then save myString to the DB field.

  4. #4
    John Holliday Guest

    Default RE: Retaining format for text extracted from <TEXTAREA>

    Replace() actually didn&#039t work because it replaces single characters and in this case "&#060;p>" is comprised of three characters. But that did point me in the right direction and I came up with my own functions to do the replacing. Everything works great now.<BR><BR>Thanks for the idea, Chris and Stephen. Have a nice 4th of July everyone!<BR><BR>John


  5. #5
    Join Date
    Dec 1969
    Posts
    119

    Default RE: Retaining format for text extracted from <TEXTAREA>

    I had the same problem some days back<BR><BR>If you just say &#060;TEXTAREA WRAP=PHYSICAL><BR>and type as you want and store the recieved data in<BR>request("TextAreaData") in a Table field. That does it.<BR>When you read it from the table field and put it in <BR>the textarea it comes as it is.<BR><BR>I had tried this with ORACLE DB and Varchar2 datatype.<BR><BR>Manish<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •