Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Break the <textarea> field value!

Status
Not open for further replies.

micjohnson

Programmer
Nov 9, 2000
86
US
I have a TEXTAREA field called "Address" on my form.

The user can type an address and stored it on the SQL Server DB.

Eg,

[highlight]Address1[/highlight]
[highlight]Address2[/highlight]
[highlight]City [/highlight]
[highlight]State [/highlight]

When i return this address and display it (as HTML), its showing me like

[highlight]Address1 Address2 City State[/highlight]

How to i display this as

[highlight]Address1[/highlight]
[highlight]Address2[/highlight]
[highlight]City [/highlight]
[highlight]State [/highlight]

I tried with CF "Replace" function but no use.

Appreciate your help.

Regards
micJ
 
You just need to format it when you display it as html.
Code:
#ParagraphFormat(Address)#


Hope This Helps!

ECAR
ECAR Technologies, LLC

"My work is a game, a very serious game." - M.C. Escher
 
Thank you ECAR. And REPLACE also working good. Earlier i misplaed the parameters.

.....
.....
<cfset othr_cnt = #Replace(contact, chr(10),"<br>","all")#>
<td>#othr_cnt#</td>

....
....

Appreciate your time
 
I use a functionality like this so much that I just made it easier on myself and use in Application.cfm

Code:
<cffunction name="linebreak">
	<cfargument name="string" required="Yes">
	<cfset var output = string>
	<cfset output = REReplace(output,"\r\n","<br/>","ALL")>
	<cfreturn output>
</cffunction>




 
I don't like to have to use the <p> tag when not appropriate, and CF 7 seems bug out...



here is what I got when i used this:
<cfoutput>#ParagraphFormat("this is the ParagraphFormat" &chr(13) & chr(10) & "this is a new line")#</cfoutput>

Code:
this is the ParagraphFormat this is a new line <P>

no new line, and a funked up <p> tag... tested it on a few blank pages too.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top