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!

Textarea Update is adding "Para Break and Tab"

Status
Not open for further replies.

tracyo

Programmer
Joined
Oct 19, 2001
Messages
3
Location
US
I have a form that allows a user to update their information. It pulls the current information from an Access Database. When it updates the database, it automatically is adding a paragraph return and a tab to the beginning of the text area infomation.

Using the Trim function, the HTML looks fine, but the information in the database has the added "paragraph break and tab". I am using CFUPDATE to update the database.

Here is the code from the "Form":
Agency Profile:
Code:
<Textarea name=&quot;agency_profile&quot; cols=&quot;50&quot; rows=&quot;10&quot;>
<CFIF NewRecord is &quot;No&quot;>
  <CFoutput query=&quot;Agency_Info&quot;>#Trim(agency_profile)# </CFOUTPUT>
	</CFIF>
 
The [COLOR=000080][COLOR=FA5000]<textarea>[/color][/color] uses all the white space and carriage returns that's in the code. So :

[COLOR=000080][COLOR=FA5000]<textarea name=&quot;agency_profile&quot; cols=&quot;50&quot; rows=&quot;10&quot;>[/color][/color]
<CFIF NewRecord is &quot;No&quot;>
<CFoutput query=&quot;Agency_Info&quot;>#Trim(agency_profile)# </CFOUTPUT>
</CFIF>
[COLOR=000080][COLOR=FA5000]</textarea>[/color][/color]

is like writing

[COLOR=000080][COLOR=FA5000]<textarea name=&quot;agency_profile&quot; cols=&quot;50&quot; rows=&quot;10&quot;>[/color][/color]

text

[COLOR=000080][COLOR=FA5000]</textarea>[/color][/color]

You can look at the source after the page is generated and see this.


The way to solve this is to do the logic before the [COLOR=000080][COLOR=FA5000]<textarea>[/color][/color] and then using 1 variable for the output, like so:

<cfscript>
if( NewRecord is &quot;No&quot;)
vTextArea = Trim(Agency_Info.agency_profile);
else
vTextArea = &quot;&quot;;
</cfscript>

<cfoutput>
[COLOR=000080][COLOR=FA5000]<textarea name=&quot;agency_profile&quot; cols=&quot;50&quot; rows=&quot;10&quot;>[/color][/color]#VARIABLES.vTextArea#[COLOR=000080][COLOR=FA5000]</textarea>[/color][/color]
</cfoutput> - tleish
 
Thanks!!! Works like a charm!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top