FormBase (open)
Form base object
Syntax
LOADLIB "mod::publisher/lib/forms/base.whlib";
OBJECTTYPE FormBase
Constructor
Variables
- STRING formbacklink
"Previous" page link for the first form page
- BOOLEAN formcheckratelimits
Whether to do a rate limit check at first BeginWork. Enabled by external submissions
- STRING ARRAY formclasses
Additional form classes
- RECORD formdataset
Custom data attributes
- STRING formid
Form ID (generally used for analytics)
- STRING formidprefix
prefix for ids. clear to disable ids
- STRING formjshandler
Form JS handler. Defaults to publisher:rpc, unless it's a legacy form (no s) which require JS registration
- STRING formnextlabel
Label for 'next page' buttoon
- STRING formprevlabel
Label for 'previous page' buttoon
- STRING formref
Form reference (persisted over RPCs, seen and possible modifyable by clients so should not contain sensitive or replayable data)
- STRING formsubmitlabel
Label for 'submit' buttoon
- STRING formsubmittype
Form submittype (new or edit)
- RECORD formvariables
'Fixed' form variables, used for conditions
- RECORD pagedata
- BOOLEAN selecthistoricvalues
Allow historic values to be selected
Properties
- PROPERTY formapplytester
Applytester for the form
- PROPERTY formcontext
Webcontext for the form
- PROPERTY formlanguagecode
Language for the form
- PROPERTY formrenderer
Rendering engine for this form
- PROPERTY formurl
URL for the the form
- PROPERTY formvalue
The current value of the form as a record
Functions
- MACRO AddFormAttributesCallback(MACRO PTR toadd)
Register form attributes callbacks, use by fields that (only) need to add data to the
<form>
- OBJECT FUNCTION AppendFormField(OBJECT parent, STRING type, STRING name, RECORD options)
Append a new field to the form
- OBJECT FUNCTION BeginWork(RECORD options)
Begin transactional work
- MACRO CheckRateLimits()
- OBJECT FUNCTION EnsureFormCaptchaPage()
- STRING FUNCTION FormatFormDate(DATETIME value, RECORD options)
- RECORD FUNCTION FormExecuteSubmit(RECORD options)
Submit the form using its current values
- OBJECT FUNCTION GetFormField(STRING findname)
Get a field by name
- STRING FUNCTION GetFormTarget()
- RECORD FUNCTION GetIndexableContent(RECORD options)
- RECORD FUNCTION GetRenderTree()
- RECORD FUNCTION GetWittyData()
- RECORD FUNCTION GetWittyResultData(RECORD options)
- OBJECT FUNCTION GetWRDAuthPlugin()
- RECORD ARRAY FUNCTION ListFields()
- RECORD FUNCTION MatchFormCondition(RECORD condition, RECORD result)
- MACRO PrefillWithSingleResult(RECORD results)
- MACRO PrepareForFrontend()
- RECORD FUNCTION PrepareFormDataForComposer(OBJECT mailcomposer, RECORD options)
- MACRO RenderForm()
- MACRO SetFormValues(RECORD ARRAY vals, RECORD options)
Set form values using a flat array. Safer when fieldnames may be long
- STRING FUNCTION StoreFormValue(RECORD options)
Store the current value of the form