Edit Form $form->data['Model ID'] don't work

Access form data with array notation in ChronoForms.

Overview

The issue occurs when using incorrect syntax to reference form data fields that use array-style naming.
To correctly access the data, reference the array name and key separately within the $form->data variable.

Answered
fa fasenderos 14 Feb, 2015
Answer
Hi,
I have followed this article to create an edit form to be called by an Edit link in a ChronoConnectivity listing.
Everything works fine, data are loaded correctly from database but according to the article linked above "All of the input names should be array names using the Model ID, e.g. Article[title]".
The problem is that in the "DB Read Conditions", this code don't work:

<?php
  return array( 'parent' => $form->data['Article[title]'] );
  ?> 


If I change the name of the input for ex
Articletitle
(without square brackets) a code like this works fine:

<?php
  return array( 'parent' => $form->data['Articletitle'] );
  ?> 


Thanks
fa fasenderos 14 Feb, 2015
Solved with

<?php
  return array( 'parent' => $form->data['Article']['title'] );
  ?> 
This topic is locked and no more replies can be posted.