2022.2

Table Of Contents
Specifyingadefaultvalue
AttributeadefaultvaluetoaText,TextareaandotherFormelementsbydraggingafieldfromtheData
Modelpanedirectlyontothefield,onceithasbeencreated.Thisalsoworkswhendraggingafieldfrom
adetailtableinarecordsetintoaFormelementthatiscontainedwithinaDynamicTable.
Notethatthedefaultvaluedoesn'tdisappearwhentheuserclicksthefield,asplaceholdersdo.To
insertaplaceholderinafield,typealabelandchooseUse label as placeholderasitsstylewhen
addingtheelementtotheform;see"AddingelementstoaForm"onpage507.
Makingelementsrequired
TochangethevalidationofaCOTGorFormelement,right-clicktheelementandchooseValidation
settings.NowyoucanchangetheForm'svalidationmethodandsettherequirementsperfield;see
"ChangingaForm'svalidationmethod"onpage643.
Groupingdatausingarrays
Groupingdatausingarrays
InaConnectsolution,whenaWebFormorCOTGFormissubmitted,thereisaWorkflowprocessthat
receivesthedataandcreatesajob data file(whichisanXMLfile).Havingarraysinthejobdatafile
greatlysimplifiescreatingadatamappingconfigurationandloopingoverdatainDesignerscripts.
Here'showtogroupdataintheHTMLsothattheygetsubmittedasarrays.
Note: Toenablesubmittingarrays,youneedtochecktheUse PHP arraysorUse enhanced
PHP arraysoptionintheHTTPServeruserpreferencesinWorkflow;seeWorkflowOnlineHelp.
Asimplemethodtocreatearraysinthejobdatafileistousetwo pairs of square bracketsinthe
nameoftheforminputs.Putthenameofthearraybetweenthefirstpairofsquarebrackets.Between
thesecondpairofsquarebrackets,definethekeytowhichthevaluebelongs.Considerthefollowing
HTMLforminputs:
<input type="hidden" name="user_account" value="pparker@eu.objectiflune.com">
<input type="text" name="name" value="Peter Parker">
<input type="text" name="company" value="Objectif Lune">
<input type="text" name="pinElm1[pin_0][left]" value="122">
<input type="text" name="pinElm1[pin_0][top]" value="253">
<input type="text" name="pinElm1[pin_0][type]" value="dent">
<input type="text" name="pinElm1[pin_1][left]" value="361">
<input type="text" name="pinElm1[pin_1][top]" value="341">
<input type="text" name="pinElm1[pin_1][type]" value="dent">
WiththeUse PHP arraysoptionenabledinWorkflow,theaboveHTMLresultsinthefollowingXML:
Page 510