Hi,
I am trying to read a local database table (a_category)in the On Submit event.
I want to retrieve records where a_category.name is the same as a value in the form.
My DB Read has a model Id of Data1.
Therefore I have added a condition to the read:
If a record is found I add a $form->errors[] entry and run the event loop.
It ALWAYS finds a record (when it shouldn't) and the PHP conditions code is displayed on the form also.
I am trying to read a local database table (a_category)in the On Submit event.
I want to retrieve records where a_category.name is the same as a value in the form.
My DB Read has a model Id of Data1.
Therefore I have added a condition to the read:
< ?php
return array('Data1.name' => $form->data['name']);
?>
If a record is found I add a $form->errors[] entry and run the event loop.
It ALWAYS finds a record (when it shouldn't) and the PHP conditions code is displayed on the form also.
Data Array
Array
(
[option] => com_chronoforms5
[chronoform] => New_Category
[event] => submit
[name] => Cat1
[description] => Cat1
[userid] => 0
[submit] => Submit
[Data1] => Array
(
[qid] => 1
[name] => Test
[description] => Test
[public] => 1
[standard] => 0
[created] => 2016-02-13 14:55:08
[userid] => 814
)
)
Array
(
)
Errors
Array
(
)
Debug Info
Array
(
[8] => Array
(
[DB Read] => Array
(
[Queries] => Array
(
[0] => SELECT `Data1`.`qid` AS `Data1.qid`, `Data1`.`name` AS `Data1.name`, `Data1`.`description` AS `Data1.description`, `Data1`.`public` AS `Data1.public`, `Data1`.`standard` AS `Data1.standard`, `Data1`.`created` AS `Data1.created`, `Data1`.`userid` AS `Data1.userid` FROM `a_category` AS `Data1`
)
)
)
)