FoxMarkup
There are many ways to build forms using Fox. Basically it provides special markup to replace the (:input form ..:)
and (:input end:)
directives while all the other (:input:)
directives can be used (see PmWiki.Forms), as well as some other special Fox directives. The submitted form input is then rendered into formatted output to some target page or location using one or more templates. More than one page or location within a page can be targeted with specific output.
Fox form structure
-
(:foxmessages:)
- Optional marker to show Fox feedback messages.
-
(:fox
formname<optional parameters>:)
- start of form. See Markup Parameters for full list of possible parameters.
-
(:fox<template|add|replace|ptv|check> ...:)
- optional other fox markup directives (see below).
-
(:input <text|textarea|checkkbox|radio|defaults|submit| etc>... :)
- various form controls including a form submit button.
-
(:foxend
formname:)
- end of form, with the same unique form name as used in the start of the form. :
Optional form markup
In addition to the start and end fox markup you can use some special markups in between. Each of these can be used multiple times. Fox will build a list of target pages with associated templates and other parameters included in each markup.
-
(:foxadd
TemplatePage=>TargetPage... :)
or(:foxadd target=... [template=...] [foxtemplate=...] ... :)
- for adding content.
-
(:foxreplace
TemplatePage=>TargetPage... :)
or(:foxreplace target=... [template=...] [foxtemplate=...] ... :)
- for replacing content.
-
(:foxcopy
TemplatePage=>TargetPage... :)
- for content copying. Note that only the template gets copied as content, no variables will be replaced. Any page attributes of the template page are ignored!
-
(:foxptv
TargetPage[ptvfields=...] [ptvfmt=...] [ptvclear=...] :)
- for adding and updating PTVs (page text variables)
-
(:foxmail template=
EMailTemplatetarget=
EMailList:)
- for sending email message to small group of recipients on EMailList (needs FoxNotify addon installed).
Page sections can be used for templates as well as targets, like DisplayTemplates#topic and TargetPage#section, and full page names can be used, as well as multiple TemplatePage=>TargetPage pairs (read more about multiple target pages).
-
(:foxtemplate "
one line template string":)
- for forms needing no multiline template. The foxtemplate markup will be used if no template page is specified. You can only use it once in a form. It is convenient for quick and short templates. Note that \n will create a line break. Within the
(:foxadd ...:)
and(:foxreplace ...:)
markup directives a foxtemplate="..one line template string" parameter can be given, instead of a template page. -
(:foxpreviewtemplate "
one line template string":)
- optional alternative template for preview invoked by a Preview button.
-
(:foxcheck
name.... :)
- setting input validation checking for input field name. See Input Validation
Markup for including a Fox form specified on another page
-
(:foxform
source:)
- source can be a page name like Site.MyEditForm or a page section defined by anchors like SomePage#contactform. If source is a plain anchored section without page name, like #editform, the section will be retrieved by default from page Site.FoxForms or page(s) given in the config variable $FoxFormsFmt. $FoxFormsFmt can be an array of page names. The first section found with the name will be used.
(:foxform
source:)
markup is encouraged, as the alternative (:include
source:)
markup drops replacement variables (since PmWiki version 2.2.14), which might be present in the form (See Enable Undefined Template Vars).