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

Format of a Textarea pre-filled by CF

Status
Not open for further replies.

philcha

Programmer
May 10, 2000
109
GB
I want to show multiple error messages as separate lines within a text area.&nbsp;&nbsp;This will enable me to show any number of error messages without them filling the whole screen.&nbsp;&nbsp;I send the output messages to the display page via a URL argument which is a CF delimited list.<br>So the display page has to break the list into lines.&nbsp;&nbsp;This is easy:<br>#Replace(Attributes.ErrList, delimiter, CrLf, &quot;ALL&quot;)#<br>(The list has Attributes scope because this code is in a custom tag).<br>I've tried the following CF code:<br>(1)<br>&lt;cfoutput&gt;<br>&nbsp;&nbsp;&nbsp;&lt;textarea rows=4, cols=80 readonly&gt;<br>&nbsp;&nbsp;&nbsp;#Replace(Attributes.ErrList, delimiter, CrLf, &quot;ALL&quot;)#<br>&nbsp;&nbsp;&nbsp;&lt;/textarea&gt;<br>&lt;/cfoutput&gt;<br>(2)<br>&lt;textarea rows=4, cols=80 readonly&gt;<br>&nbsp;&nbsp;&nbsp;&lt;cfoutput&gt;<br>&nbsp;&nbsp;&nbsp;#Replace(Attributes.ErrList, delimiter, CrLf, &quot;ALL&quot;)#<br>&nbsp;&nbsp;&nbsp;&lt;/cfoutput&gt;<br>&lt;/textarea&gt;<br><br>In both cases the first line of the text area is indented while the rest are not, e.g.<br>&nbsp;&nbsp;&nbsp;Message 1<br>Message 2<br>Message 3<br>and I don't want any lines to be indented.<br><br>I've tried defining a style for the textarea with text-indent:0 (both inline and as a separate style block), but this does not cure the problem.<br><br>Can anyone help?
 
i've got more or less the same pb : i get some **inserted lines** but i don't want any to be inserted !<br>the code is :<br><br>&nbsp;&lt;CFFILE ACTION=&quot;Read&quot; FILE=&quot;.../z.txt&quot; VARIABLE=&quot;Message&quot;&gt;<br><br><br>&lt;cfoutput&gt;<br>&lt;form name=&quot;toto&quot; method=&quot;post&quot; action=&quot;.../zz.cfm&quot;&gt;<br>&lt;textarea name=&quot;titi&quot; cols=50 rows=20 wrap=&quot;hard&quot;&gt;<br>#Message#<br>&lt;/textarea&gt;<br>&lt;input type=submit value=&quot;mettre a jour le fichier&quot;&gt;<br>&lt;/form&gt;<br>&lt;/cfoutput&gt;<br><br>and in zz.cfm :<br><br>&lt;CFFILE ACTION=&quot;Delete&quot; FILE=&quot;.../z.txt&quot;&gt;<br>&lt;CFFILE ACTION=&quot;Write&quot; FILE=&quot;.../z.txt&quot; OUTPUT=#titi#&gt;<br><br>if anyone could help !!<br><br>
 
philcha - I <b>believe</b> that the TEXTAREA tag acts a lot like the PRE tag, in that text inside it will format however you have your code (line breaks and all)...<br><br>Try this:<br><br>&lt;cfoutput&gt;&lt;textarea rows=4, cols=80 readonly&gt;#Replace(Attributes.ErrList, delimiter, CrLf, &quot;ALL&quot;)#&lt;/textarea&gt;&lt;/cfoutput&gt;<br><br>(all on one line) and let me know if this takes care of it....<br><br>iza - The same applies with you:<br><br>&lt;textarea name=&quot;titi&quot; cols=50 rows=20 wrap=&quot;hard&quot;&gt;#Message#&lt;/textarea&gt;<br><br>Your code should be on one line.&nbsp;&nbsp;Also, on your CFFILE ACTION=&quot;Write&quot; tag try this:<br><br>&lt;CFFILE ACTION=&quot;Write&quot; FILE=&quot;.../z.txt&quot; OUTPUT=#titi# <b>ADDNEWLINE=&quot;NO&quot;</b>&gt;<br><br>The CFFILE tag will by default add a newline character to the end of any file it writes....&nbsp;&nbsp;Again, let me know if this works...
 
Thanks, DarkMan.<br><br>Putting &lt;textarea&gt;contents&lt;/textarea&gt; all in one line formatted it the way I wanted, although it makes the code harder to read.
 
thanxxxx !!!<br><br>&lt;textarea name=&quot;titi&quot; cols=50 rows=20 wrap=&quot;hard&quot;&gt;#Message#&lt;/textarea&gt;<br>was the way i was doing it already, <br><br>but adding ADDNEWLINE=&quot;NO&quot; on the cfile is fine !!! everything works all right now :]] thanxxxx<br><br>how does it come that this is NOT in the doc ??<br><br><br>&nbsp;<br>&nbsp;<br>&nbsp;<br>
 
It is in the online help that comes with CF Studio 4...&nbsp;&nbsp;I don't know why it wouldn't be in the paper docs... Go figure.<br><br>DM
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top