2022.2

Table Of Contents
<type>dent</type>
</pin_1>
</pinElm1>
</values>
WiththeUse enhanced PHP arraysoption,theXMLlookssimilar,butinthiscase,thevaluebetween
thefirstpairofsquarebracketsisexpectedtoconsistoftwoparts,separatedbyanunderscore(e.g.
row_0).Thefirstpartbecomestheelement'sname.Allcontentafterthefirstunderscore(preferablyan
integer)isgivenasanattributeoftheelement(e.g.<row_idx=0>).TheaboveHTMLresultsinthefol-
lowingXML:
<values count="4">
<user_account>pparker@eu.objectiflune.com</user_account>
<name>Peter Parker</name>
<company>Objectif Lune</company>
<pinElm1>
<pin _idx=0>
<left>122</left>
<top>253</top>
<type>dent</type>
</pin>
<pin _idx=1>
<left>361</left>
<top>341</top>
<type>dent</type>
</pin>
</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:
Page 540