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

preserver newline in select field 1

Status
Not open for further replies.

brianpercival

Programmer
Jun 13, 2005
63
US
Hi,

not exactly a cf question, but how can I have a form "select" field which goes multiple lines. which I later store in a database table field. When I cfoutput it, how do I retain the new lines?
 
Are you asking how to store which value is selected in the database i.e. I have options 1, 2, and 3. When I select 2 store 2 in the database. Upon record retrieval select 2 in the drop down?
 
I think you mean textarea, not select, correct? the line breaks ARE saved in the DB you just have to turn them into HTML when you output it.

<cfoutput>#replace(yourQuery.colName, chr(10), "<br>", "All")#</cfoutput>

We've heard that a million monkeys at a million keyboards could produce the complete works of Shakespeare; now, thanks to the Internet, we know that is not true.
 
TruthInSatire,

thanks a lot. I mistyped.. textarea. not select I apologize.thanks for the ans. it works.

regards,
Brian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top