Hi,
I'm having problems with passing the value from a select list in my form.
I have a dropdown in my form with the names of users. I want to pass the selected user by it's uid to another function.
When validating i get the error 'no user' which I defined in the validation section.
I cannot figure out how it's done. Can somebody help me please ?
function uc_grouporder_create($uid = NULL) {
global $user;
if ($uid !== NULL) {
$order = uc_grouporder_new($uid, 1);
uc_order_comment_save($order->order_id, $user->uid, t('Order created by groupuser.'), 'admin');
drupal_goto('admin/store/orders/'. $order->order_id .'/edit');
}
$output = drupal_get_form('uc_grouporder_create_form');
return $output;
}
function uc_grouporder_create_form() {
global $user;
$form['customer'] = array(
'#type' => 'fieldset',
'#title' => t('New order customer'),
'#description' => t('Use the dropdown to create a blank order for the given user.'),
'#collapsible' => FALSE,
);
$formname="USER";
$vocabulary = db_query("select distinct a.uid, us.name from uc_address a inner join users us on us.uid=a.uid inner join users_roles ur on a.uid=ur.uid where rid in (select rid from users_roles where uid=%d)",$user->uid);
while ($term = db_fetch_object($vocabulary)) {
$options[$term->uid] = $term->name;