hi all,
I have set up a select list as custom code (options are dynamically filled from table) after checking code using a drop down element and checking its code in the code tab.
this one works:
this one shows up but does not work properly. if I select the first client in the list I get the 'Pls choose a value' error. only when selecting any other client can I submit.
do u have any idea whats wrong?
J!2.5.9; CF4.0 RC3.5.2
I have set up a select list as custom code (options are dynamically filled from table) after checking code using a drop down element and checking its code in the code tab.
this one works:
<?php $database =& JFactory::getDBO(); ?>
<select size="1" class=" validate['required']" title="" name="custodian_id">
<option value="">- Please Select -</option>
<?php $database->setQuery("SELECT * FROM #__chronoforms_data_custodians ORDER BY `custodian_name`, `country`");
$custodians = $database->loadObjectList();
foreach ( $custodians AS $custodian) {
$option = $custodian->custodian_name.', '. $custodian->country;
echo "<option value='" . $custodian->cf_id . "'>" . $option . "</option>";
} ?>
</select>
this one shows up but does not work properly. if I select the first client in the list I get the 'Pls choose a value' error. only when selecting any other client can I submit.
<?php $database =& JFactory::getDBO(); ?>
<select size="5" class=" validate['required']" title="" name="client_id">
<?php
$user = JFactory::getUser();
$database->setQuery("SELECT * FROM #__chronoforms_data_clients WHERE `im_uid` =". $user->id ." ORDER BY `client_name`, `country`");
$clients = $database->loadObjectList();
foreach ( $clients AS $client) {
$option = $client->client_name.', '. $client->country;
echo "<option value='" . $client->cf_id . "'>" . $option . "</option>";
} ?>
</select>
do u have any idea whats wrong?
J!2.5.9; CF4.0 RC3.5.2