[pmwiki-users] Fox forms and newlines

Eemeli Aro eemeli at gmail.com
Tue Jun 2 04:37:15 CDT 2009


2009/6/2 Randy Brown <randy at brownragfilms.com>:
> I want the user to type in a form without worrying about markup. OTOH,
> I want what's saved on the page to be a Page Text Variable.
>
> For example, the user types into the textarea associated with the page
> text variable MyPTV:
>
> Line 1
> Line 2
>
> And the form saves on the page:
>
> MyPTV: Line1\\Line2
>
> I can do that now with a filter. But since the form starts with the
> value of MyPTV as the default, the next time the user uses the form,
> he or she will see:
>
> MyPTV: Line1\\Line2
>
> which will be confusing since it includes markup. I want the user to
> see two separate lines without markup.

Take a look at <http://www.pmwiki.org/wiki/Cookbook/EditAttributes>.
It can read page text variables as well as page attributes and present
them as separate edit boxes. It'll also let you define a filter
function for your data, and that filter function could check the value
of $EnablePost to either replace each \\ with a newline or vice versa.

eemeli



More information about the pmwiki-users mailing list