memo/textarea wrapping

Results 1 to 3 of 3

Thread: memo/textarea wrapping

  1. #1
    Join Date
    Dec 1969

    Default memo/textarea wrapping

    Are there any suggestions or references on how to store a chr(13) (enter key) in a database either in a memo field and return it when called on? I have a textarea that the user can enter text into, but if he/she presses enter in the text are to start a new line, it is stored this way in the database, but when writing it back to the screen by displaying the field ( <%=rs.fields ("MemoField")%>), It just displays all the text as one line. Any ways to fix this? Thanks.

  2. #2
    Ravi Kanth S Guest

    Default RE: memo/textarea wrapping

    Sometime Back even I have the same problem...<BR>I don&#039t know whether I am right or not But I solved the problem<BR>of displaying the value on the browser as below<BR><BR>&#060;textarea name="body" align=left <BR> COLS=75 ROWS=10 wrap=physical <BR> style=" BORDER-RIGHT: 0px; BORDER-TOP: 0px; <BR> LEFT: 0px; VISIBILITY: visible; <BR> OVERFLOW: visible; BORDER-LEFT: 0px; <BR> BORDER-BOTTOM: 0px; TOP: 0px"&#062;<BR> &#060;%=objMessageRs("Message")%&#062;<BR>&#060 ;/textarea&#062;<BR>This will display the Recordset value as You expect<BR>If You got someway to store the values with line breaks into the database please let me know<BR><BR>Hope It helps You<BR>Happy Programming and wish You a very happy and successful New Year<BR>

  3. #3
    David Chase Guest

    Default RE: memo/textarea wrapping

    Paul,<BR><BR>I&#039m sure many others can give a much better answer than me, so assume my answer is a last resort. :-) First thing to check is that your text area has &#060;textarea wrap="hard"&#062;. This should force the whitespace into your database. However this seems to be happening -- you said your database records have a chr(13) in them.<BR><BR>Likely you&#039re a victim of the CR+LF issue. On some computers / browsers a simple Carriage Return -- chr(13) -- is enough to make it skip to a new line. However in the old days of typewriters a Carriage Return simply returned the carriage to the start of the line, it didn&#039t necessarily scroll to a new line. Hence, the only way to go to a new line with an old typewriter was to hit Carriage Return, then Line Feed, which would advance the current line. This sometimes odd behaviour has lasted even in the digital age, and many programs require both a Carriage Return -- chr(13) -- and a Line Feed -- chr(10). <BR><BR>Try replacing all lone CR&#039s with CR+LF. Or in code: <BR><BR>MyString = Replace( MyString, chr( 13 ), chr( 13 ) & chr( 10 ) )

Posting Permissions

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