Displaying data AS INPUTTED

Results 1 to 4 of 4

Thread: Displaying data AS INPUTTED

  1. #1
    Jay-C Guest

    Default Displaying data AS INPUTTED

    I have data in the form of MEMO on an Access database. When I Response.Write it, it comes out all in one paragraph. How do I make it output the same way as in the messageboard where, what you input in the form is what you see when people view the output. Eg...<BR><BR>Input:<BR>This is the first line.<BR>This is the 2nd line.<BR><BR>aspmessageboard&#039;s output:<BR>This is the first line.<BR>This is the 2nd line.<BR><BR>My output:<BR>This is the first line. This is the 2nd line.<BR><BR>Thanks in advance.

  2. #2
    Join Date
    Dec 1969

    Default RE: Displaying data AS INPUTTED

    With HTML, the *ONLY* places where end-of-line characters are preserved are in TEXTAREA controls and in certain tagged areas, such as &#060;PRE&#062;...&#060;/PRE&#062;.<BR><BR>The usual thing that most people do is<BR><BR>&#060;%<BR>...<BR>Response.Write Replace( RS("someTableField"), vbLF, "&lt;BR&#062;" )<BR>...<BR>%&#062;<BR><BR>to change the line feed character into the usual HTML "break" sequence.<BR><BR>It still won&#039;t be "AS INPUTTED". Multiple spaces are always converted to single one. Spaces at the beginning of lines disappear. Etc. HTML is *NOT* designed to retain the original format of the text. After all it *IS* a "Markup Language" [the ML in HTML], *not* a text editor.<BR><BR>You *might* try using &#060;PRE&#062;...&#060;/PRE&#062;.<BR><BR>Oh...and what do you do if your user types in something that includes &#060;/PRE&#062;&#060;SCRIPT&#062;window.open("annoyingPa ge.html","_blank")&#060;/SCRIPT&#062; ???<BR><BR>The issues surrounding the display of user entered text back in a web page are *not* trivial ones.<BR><BR><BR><BR>

  3. #3
    Jay-C Guest

    Default Works unless they put in <% and %>, than

    Thanks Bill.

  4. #4
    Join Date
    Dec 1969

    Default stripHTML

    there&#039;s a copy and paste function for this at http://www.infinitemonkeys.ws/infinitemonkeys/codelibrary/<BR><BR>j

Posting Permissions

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