textarea

Results 1 to 4 of 4

Thread: textarea

  1. #1
    Marie Guest

    Default textarea

    I&#039ve used textarea for comments, but when displaying, the value in the textarea became a long sentence. What should I do to make it not in long sentence??<BR><BR>Comments: &#060;textarea rows="5" cols="30" Name=Comment>&#060;/textarea><BR>Result that I&#039ve entered :<BR>Comments: Testing. <BR> To see if it is still in long sentence.<BR> End.<BR><BR>At the Output,<BR>The Comment you gave is : <BR> &#060;% =request.form("Comment") &#037;&#062;<BR><BR>Result at output,<BR>The Comment you gave is: <BR> Testing. To see if it is still in long sentence. End.<BR><BR><BR>

  2. #2
    Mark Wilson Guest

    Default RE: textarea

    What you need to do is replace the line break characters in the returned text with <BR> or &#060;p> tags before writing to the page.<BR><BR>You can do this with:<BR><BR>&#060;%= Replace(Request.form("Comment"), chr(10), "<BR>") &#037;&#062;<BR><BR>the replace function searches through the first string for each occurance of the second string and replaces it with the third [note: chr(10) is the linefeed character]<BR>

  3. #3
    Sam Otto Guest

    Default RE: textarea

    I&#039m not sure if this helps but you may want to look at the WRAP attribute of a &#060;textarea>. It has to do with line breaks....

  4. #4
    Join Date
    Dec 1969
    Posts
    168

    Default RE: textarea

    Try this for your output:<BR>&#060;%<BR>Function FormatStr(String)<BR> on Error resume next<BR> String = Replace(String, CHR(13), "")<BR> String = Replace(String, CHR(10) & CHR(10), "&#060;/P>&#060;P>")<BR> String = Replace(String, CHR(10), "<BR>")<BR> FormatStr = String<BR>End Function<BR>&#037;&#062;<BR>The comment you gave was:<BR><BR>&#060;%=formatStr(request.form("Commen t"))&#037;&#062;<BR><BR>Hope this helps... Cheers!


Posting Permissions

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