Fox Input Validation

Summary: examples for using Fox input validation
Version: 2008-03-06
Prerequisites: PmWiki 2.2.0 beta, Fox
Status: new
Maintainer: HansB?
Categories: Uncategorized

Questions answered by this recipe

How do I create a form which uses input validation?
How can I check for correct form input?
How can I make sure users don't submit forms with empty input fields?

Examples for Fox form validation

Example 1

%red%(:foxmessage form1 ptvupdate=1 list=nocheck:)
(:fox form1 template=Site.FoxTemplates#example :)
(:foxcheck target match='Test*' msg="pagename needs to begin with: Test":)
(:foxcheck date regex='[12]\d\d\d-(0\d|1[0-2])-([0-2]\d|3[01])' msg='please enter date as YYYY-MM-DD':) 
(:foxcheck time regex='([0-1]\d|2[0-3]):[0-5]\d' msg='enter time as HH:MM using 24 hour format':)  
(:foxcheck author msg='please sign as author!':) 
Page: (:input text target:) %red%(:foxmessage form1 target:)%%\\
Date: (:input text date:) %red%(:foxmessage form1 date:)%%\\
Time: (:input text time:) %red%(:foxmessage form1 time:)%%\\
Author: (:input text author:) %red%(:foxmessage form1 author:)%%\\
(:input submit post Enter:)
(:foxend form1:)


Release Notes

If the recipe has multiple releases, then release notes can be placed here. Note that it's often easier for people to work with "release dates" instead of "version numbers".

See Also