Adding Carriage return/line feed to a text field
Hi, I have a form that the field length for that element is set to 65k in the database. Using a textbox, the person can enter their information. I now want to view the text. I can again use a text box but what I want to do is this - <dtml-var mytext> If I use this format, the text is one line. Are there arguments or a script that will add carriage return/line feed after you set the parameters? Thanks, Larry McDonnell Coordinator of Educational Technology New Haven Public Schools 54 Meadow Street New Haven, CT 06519 larry.mcdonnell@new-haven.k12.ct.us (203) 946-2440
MCDONNELL, LARRY wrote:
I have a form that the field length for that element is set to 65k in the database. Using a textbox, the person can enter their information. I now want to view the text. I can again use a text box but what I want to do is this –
<dtml-var mytext>
If I use this format, the text is one line. Are there arguments or a script that will add carriage return/line feed after you set the parameters?
You can wrap it in HTML <pre> tags. This preserves formatting on layout. Otherwise, you'll have to replace the newlines in your text with <br/> tags. Products.PythonScripts.standard.newline_to_br will do this for you, as will the newline_to_br attribute on the dtml-var tag. (You can find this in the Zope online help.) --jcc
If you are using a textarea field for input you could also use a text area field for display, useful if the input might contain html tags. Therwise wrap the display in <pre> tags. Cliff MCDONNELL, LARRY wrote:
Hi,
I have a form that the field length for that element is set to 65k in the database. Using a textbox, the person can enter their information. I now want to view the text. I can again use a text box but what I want to do is this -
<dtml-var mytext>
If I use this format, the text is one line. Are there arguments or a script that will add carriage return/line feed after you set the parameters?
Thanks,
Larry McDonnell
Coordinator of Educational Technology
New Haven Public Schools
54 Meadow Street
New Haven, CT 06519
larry.mcdonnell@new-haven.k12.ct.us
(203) 946-2440
------------------------------------------------------------------------
_______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
participants (3)
-
Cliff Ford -
J Cameron Cooper -
MCDONNELL, LARRY