This is a newbie question... I have a form in Joomla 3.3 and chronoforms v5 latest... When the form loads the database populates my first select input with "interview dates" from my DB.... works great, once you select the date, the second select input populates with available time slots.... the problem here is the way the DB is output in the array is
Data-> time->7:00am,7:15am,9:30am
Right now when the 2nd select loads it's showing up like this 7:00am,7:15am,9:30am.... I want to be able to make them individual values not all one value... This is the code I am currently using for the "time" options for the second select input...
<?php
$options = array();
if ( !$form->data['Data'] || count($form->data['Data']) < 1 ) {
// no result was found
$options[] = 'Please select a category';
} else {
foreach ( $form->data['Data'] as $d ) {
$options[$d['interviewdate']] = ($d['time']);
}
}
echo json_encode ($options);
?>
is this possible?
If i am not mistaken your
$d['time']holds values like '7:00am,7:15am,9:30am'. And if this is the case then you can just useexplode(',', $d['time'])which will give you array of times instead of string.