Dropdown with name(usersjoomla) of one group (53 sample)
Put Custom Code in Setup BEFORE html render_FORM
This code creates an array in $form->data under a model name 'users'
This array is posible read from dropdown
thomaswebb
Put Custom Code in Setup BEFORE html render_FORM
This code creates an array in $form->data under a model name 'users'
This array is posible read from dropdown
<?php
$options = array();
$db =& JFactory::getDBO();
$query = "
SELECT `u`.`id`,`u`.`name`,`g`.`user_id`,`g`.`group_id` FROM `w47fa_users` AS `u`, `w47fa_user_usergroup_map` AS `g` WHERE `u`.`id` = `g`.`user_id` AND `g`.`group_id` = 53
";
$db->setQuery($query);
$data = $db->loadObjectList();
foreach ( $data as $d ) {
$form->data['user'][]= array('id'=>$d->id,'name'=>$d->name);
}
?>
thomaswebb
This topic is locked and no more replies can be posted.