[Zope] Displaying the text from a text area

Robert Leftwich robert@leftfieldcorp.com
Sun, 15 Aug 1999 11:09:25 +1000


Problem 1 occurs because you are using the same name on form 2 for the
notes field and this field already exists in the REQUEST from the
previous form, which causes Zope to concatenate them into a list.
A simple fix is to use different names on each form.

Problem 2 can be rectified by using the newline_to_br format on your var
i.e.

<!--#var "notes" newline_to_br -->

which as you can guess converts cr/lf's to <br>'s 

Robert Leftwich


Timothy Grant wrote:
> 
> Hi folks,
> 
> This seems like it should be simple, but I haven't been able to figure
> it out.
> 
> I have a text area called "notes" for users to--appropriately
> enough--enter notes on a transaction.
> 
> The notes field carries beautifully across two different forms, allowing
> the user to append information to the field if they need to when they
> are viewing the second  form. I then want to display the entered text in
> printable/e-mailable form on the third page.
> 
> I have discovered the following behaviour, that while understandable is
> not desirable--at least for what I'm implementing:
> 
> Form 1:
> 
> <p><b>Notes:</b><br>
> <textarea name="notes" wrap="on" cols="80" rows="10">
> </textarea></p>
> 
> Form 2:
> <p><b>Notes:</b><br>
> <textarea name="notes" wrap="on" cols="80" rows="10">
> <!--#var notes-->
> </textarea></p>
> 
> Undesirable behaviour one--
> 
> Using this method, I end up with a Python List on the third page. The
> first item in the list is the text that was entered on the first page,
> the second item on the list is the text that was entered on both the
> first and second pages.
> 
> Undesirable behaviour two--
> When I go to display the text using <!--#var notes--> not only do I get
> both items from the list, but I get untranslated CR/LF pairs.
> 
> Any solutions to either of these little problems would be greatly
> appreciated.
> 
> --
> Stand Fast,
>     tjg.
> 
> =======================
> Timothy Grant
> Red Hat Certified Engineer
> VP Technology/CTO
> Avalon Technology Group
> tjg@avalongroup.net
> www.avalongroup.net
> (503) 246-3630
> (503) 246-3124 Fax
> 
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://www.zope.org/mailman/listinfo/zope
> 
> (To receive general Zope announcements, see:
> http://www.zope.org/mailman/listinfo/zope-announce
> 
> For developer-specific issues, zope-dev@zope.org -
> http://www.zope.org/mailman/listinfo/zope-dev )