2022.2

Table Of Contents
</pinElm1>
</values>
Thisoptionmakesiteasiertoselectallelementsonthesamelevelinadatamappingconfiguration,
andtoconverttheXMLtoaJSONobject.
YoucantryoutthisfeaturewiththeCOTGTimeSheettemplate,asexplainedinthishow-to:UsingThe
PHPArrayOption.TheCOTGFieldsTableelement(see"FieldsTable"onpage637)inthattemplate
hasanAddbuttontoaddrowstoatable,andgroupsdatafollowingthisapproach.
Gettingthestatusofuncheckedcheckboxesandradiobuttons
Uncheckedcheckboxesandradiobuttonsarenotsubmitted(asperstandardHTMLbehavior),sohow
togetthestateofthosecheckboxesandradiobuttons?Acommonapproachtogetthestateof
uncheckedcheckboxesandradiobuttonsistoaddahiddenfieldtotheFormwiththesamenameas
thecheckboxorradiobutton,forexample:
<input type="hidden" name="status_1" value="0" />
<input type="checkbox" id="status_1" name="status_1" value="1" />
Whenmultiplefieldswiththesamenameareencountered,thepreviousvalueisoverwritten.Thisway
thevaluesforuncheckedcheckboxesandradiobuttonscanbeprocessedeasily.
Tip: TheCaptureOnTheGo(COTG)pluginautomaticallyaddsahiddenfieldforevery
uncheckedcheckboxonaFormwhentheFormissubmitted.ItdoesthisforeveryForm;thetem-
platedoesn'thavetobeaCOTGtemplate.(See:"UsingtheCOTGplugin"onpage545.)
Using JavaScript
JavaScriptfiles,librariesandframeworkscanbeaddedtoatemplate,primarilyforuseinWebpages
andCaptureOnTheGoForms..
Whichkindoflibraryorframeworkyou'llwanttoworkwithdependsonthetypeoffeaturesyoureally
desire.Forabitofhelpwiththatandafewexamples,seethishow-to:Usingexternallibraries.
SomeJavaScriptfilesareaddedautomatically:WhenyoucreateatemplatewithaCOTGTemplate
Wizard(see"CaptureOnTheGotemplatewizards"onpage525),theDesignerautomaticallyaddsthe
jQuerylibraryv.3.5andtheCOTGlibrary:cotg-2.1.0.js.ThisalsohappenswhenyouaddaCapture
OnTheGo(COTG)elementtoatemplatethatyoudidn'tstartwithaCOTGtemplatewizard.Formore
informationaboutthisplugin,see"UsingtheCOTGplugin"onpage545.CaptureOnTheGoandJum-
botrontemplatewizardsautomaticallyaddtheFoundationfilesv.5.5.1totheresourcesofthetem-
plate.FormoreinformationabouttheuseofFoundationintheDesigner,see"UsingFoundation"on
page528.
Page 512