[pmwiki-users] Fun with forms - 3 ideas

Hans design5 at softflow.co.uk
Fri Apr 20 02:38:11 CDT 2007


Friday, April 20, 2007, 2:05:48 AM, Patrick wrote:

>> 1. We need some kind of form validation, or at least, a way to write a
>> function that will intercept the posted data and decide to filter, sanitize,
>> save it or not. 

> I'm leaving this as recipes for now... but we can also do
> javascript client-side validation in addition to server-side
> validation.

Can the new PmWiki form processor have  a hook so recipes can be
written to add filter functions, for pre-processing fields?
I had this lately added to Fox and find it very useful.
One can set

  (:input hidden foxfilter FilterOne,AnotherFilter,ETCFilter:)
  
and Fox will use functions associated with these names (in a
FoxFilterFunctions array) in the order specified, before doing its own
field processing.

I am not suggesting to use this format, but the idea of a filter hook,
which will look for filter functions if specified, which in turn be
used in sequence to pre-process field values, even add new fields to
the array etc.

For instance FoxForum uses several filters for the comment form:
one to increase a PTV by 1 for a counter, one for doing the ptvreplace
(as I have not added this function to fox.php itself yet), and others for
getting the topic title and group right, and doing an early security
check.

If PmWiki's form processing gets extensible in such manner I am
looking forward to scrap Fox. :)

  ~Hans




More information about the pmwiki-users mailing list