Loop only returns the last data element

vanelliott 24 Aug, 2024

Still learning Chronoforms 8 but now stumped trying to use a loop for the firt time. I perform a database query to get a small array of id numbers, then create a loop to iterate through that loop and:

  • Perform another database query to lookup up the link_name for each id number in the array
  • Create a checkbox with the link_name as the name, and id as the value

The form is created properly on the page, with a checkbox with a nice title for each link, and correct values. But when the form is submitted only the last checkbox value is returned. Also, the debug data only ever shows the last element of that array. Have tried everything I can think of, and just can't get it to work, hoping someone could point me in the right direction. 

Max_admin 10 Sep, 2024

apologies for the late reply

Are you setting the data source for the checkboxes ? you need to prepare the checkboxes options first then set that as the data source

Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
You need to login to be able to post a reply.