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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

replace ?? 1

Status
Not open for further replies.

mimi2

Technical User
Apr 2, 2002
407
CA
well, i you could tell me what this is supposed to do ... i'll be grateful

<CFPARAM NAME=&quot;Form.Message&quot; DEFAULT=&quot;#Chr(10)##Chr(10)##Replace(Client.Sig,Chr(10),&quot;<BR>#Chr(10)#&quot;)#&quot;>

<!-- Numbers from 0 to 31 are the standard, nonprintable ASCII codes.
For example, Chr(10) returns a linefeed character and Chr(13) returns
a carriage return character. Therefore, the two-character string
Chr(13) & Chr(10) is the newline string. -->
 
Hey Mimi,

The cfparam tag is creating a form variable in case it is not part of the form submission. This is unusual since form variables are fixed and you know they will always be present but I can think of a couple of scenarios where this might be necessary.

If the form variable doesn't exist, the cfparam tag will take the client variable client.sig and replace all line breaks with <br> tags. This is a common way of taking text formatted in a text editor and making sure line breaks are shown in the html version.

If you have a <textarea> on one of your forms and someone types in several paragrahps, the lines of text are seaparated by line break characters which have an ascii value of 10. If you want to display the text in an html page, replacing these with <br> will make sure the paragraphs are displayed as they were originally typed in.

Hope this makes sense,
GJ

 
I'm new to coldfusion but ain't ther a function called something like htmlEditFormat. i.e u pass the value of the text area to it &then output it using the above function.

Excuse me for talking complete nonsense which i probably am.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top