Input Form Controls

Fox works fine with the standard PmWiki (:input type name .... :) form controls. Standard input as well as array input can be processed. The name of the input control can be used as a replacement variable with syntax {$$name} in the template and in other form fields as value. When using controls for multiple selection or multiple inputs, for instance with (:input select ... :), use name[] in the form and {$$name[]} in the template to create an input array.

There are other special considerations to be made:

  • As an enhancement to security the submit button needs to be named post.
  • If you want to prevent the posting of empty multi-line textarea fields, name the control text.
  • Do not use template as name for an input control.
  • target and newedit are reserved names for target pagenames. An input text box can be used to set a pagename value. If this control is named target, Fox will post to the pagename entered, if the control name is newedit, Fox will open the target page in edit mode.
  • foxgroup is a reserved name for a target group. A GroupName for the target page can be specified using an input control of name foxgroup, for instance a (:input text foxgroup:) or (:input select foxgroup GROUP1:) etc.
  • Error and success messages can be displayed by putting markup (:foxmessage:) into the page, best just above the Fox form (recommended, as often page posting permissions are not set properly). See also use with Input Validation. But for messages to be displayed the form may not redirect on submission; so if you want the form to redirect to another page after posting, but need to do debugging, disable the redirect parameter temporarily, in order to see messages.
  • To retain input values after posting use parameter keepinput=1. Use keepinput=name1,name2,name3 etc. to keep the input values for fields name1, name2, name3 etc.
  • One can also use form markup like (:input default source=GROUP.PAGENAME:) to populate fields with PTV values from a different page (or indeed the current page with source={$FullName} ). The names of such fields should be prefixed with $:, for instance like (:input text name=$:someptv:). In the form one can then also use replacement variables with syntax like {$$:someptv}, for instance inside markup expressions, which get evaluated when the form is processed.

<< Markup Parameters | Index | Input Validation >>