dpinto04
asked on
Carriage return wont show up in textarea
Hi,
Heres the situation:
I have a Textarea whose contents are turned into a css file (using the ASP FSO).
When I press "enter" in the Textarea, the CSS file is created properly with each line appearing one below the other.
But when i read this same CSS file into a textarea again, for editing, the carriage returns dont appear. All the content is on one line.
How to solve this?
Heres the situation:
I have a Textarea whose contents are turned into a css file (using the ASP FSO).
When I press "enter" in the Textarea, the CSS file is created properly with each line appearing one below the other.
But when i read this same CSS file into a textarea again, for editing, the carriage returns dont appear. All the content is on one line.
How to solve this?
ASKER
oops... didnt work.
Remember, i'm reading into a textarea. All that files content is going to go into a textarea.
Remember, i'm reading into a textarea. All that files content is going to go into a textarea.
did u try with vbCrLf also ??
Replace(strmyfield, vbCrLf, "<br>") doesnt hold the textarea formatting for u ?
can u post some part of ur code to show u set and retirve the textarea content
Replace(strmyfield, vbCrLf, "<br>") doesnt hold the textarea formatting for u ?
can u post some part of ur code to show u set and retirve the textarea content
try this also when displaying
replace(strmyfield,chr(10) ,"<BR>")
replace(strmyfield,chr(10)
ASKER
I kinda solved it myself. I replaced vbcrlf with Chr(13) when creating the file and then replace chr(13) with vbcrlf when its got into the text area.
thats gr8..
u can post a zero question at Community Support to refund ur points(https://www.experts-exchange.com/Community_Support/)
u can post a zero question at Community Support to refund ur points(https://www.experts-exchange.com/Community_Support/)
ASKER
Its Chr(13) not Chr(10), and <br> in a textarea will show up as <br> itself and not a linebreak.
vbCrLf is actually the shortcut for Chr(13) & Chr(10)
Response.Write("Expert Exchange. ") & vbCRLF
Response.Write("Asp TA ") & vbCRLF & vbCRLF & vbCRLF
Response.Write("ASP programming!")
FormVal = Replace(FormVal,vbCrLf,"<b r>")...
in asp code we can replace VbCrLf with <br>, so that the input of a textarea gets formatted for display.
thats what i was asking u as to how u saved the file...
Response.Write("Expert Exchange. ") & vbCRLF
Response.Write("Asp TA ") & vbCRLF & vbCRLF & vbCRLF
Response.Write("ASP programming!")
FormVal = Replace(FormVal,vbCrLf,"<b
in asp code we can replace VbCrLf with <br>, so that the input of a textarea gets formatted for display.
thats what i was asking u as to how u saved the file...
ASKER
:-) anyways
PAQ and refund points..please
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Replace(strmyfield, vbLf, "<BR>") 'if vbLf doesnt work try with vbcrlf
you need to replace the newline character with <br> to get it displayed properly