[pmwiki-users] Fox update: adding input validation and flexible messages

Hans design5 at softflow.co.uk
Thu Mar 6 05:28:19 CST 2008


Inspired by the (:template requires ..:) markup from PmForm
I updated fox.ph and added input validation checking to Fox via a new
(:foxcheck name ...:) markup.

See info at http://www.pmwiki.org/wiki/Cookbook/Fox#foxcheck

foxcheck will use parameters match=string  and if=condition and
regex=pattern. This last one is useful to create very precise match
patterns as input masks.

msg='error message' can be used to deliver custom messages if the
check fails.

I added a flexible markup (:foxmessage:), which
can be used as
   (:foxmessage formname fieldname:)
to display validation error messages right next to the input field
which caused the error.

The foxmessage output is inline text and can be formatted with wiki
markup and styles, ie. %red%(:foxmessage:) will show the message in
red.

I advise anyone upgrading fox.php to change any (:messages:) markup
used for Fox forms to a (:foxmessage:) markup, and style it as you
like.

For the time being any Fox abort message will also be displayed
by the (:messages:) markup, but the individual page process messages
(success and failure message for each target page) are NOT displayed
any longer by (:messages:), and you will need (:foxmessages:) for
these.

Thanks for any suggestions and feedback!

  ~Hans   




More information about the pmwiki-users mailing list