0

I have drop down in a form as follows and i want to load a table of data using the drop down value , here is i have tried ,

function list_user_form(){
     $form['howmany'] = array(
    '#title' => t('List all the users in a group'),
    '#type' => 'select',
    '#options' => select_usergroup_dropdown_options(),
    '#default_value' => $default,
    '#ahah' => array(
      'path' => 'mailusers/listuserstable',
      'effect' => 'fade',
    ),

  );
   $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Click Me'),
  );
   return $form;
}

function listuserstable(){
//make html for the table and rendering it 
}

But unfortunately it gives me 403 error , please help

0

Try to add some wrapper to your table:

function list_user_form(){
   $form['howmany'] = array(
      '#title' => t('List all the users in a group'),
      '#type' => 'select',
      '#options' => select_usergroup_dropdown_options(),
      '#default_value' => $default,
      '#ahah' => array(
         'path' => 'mailusers/listuserstable',
         'effect' => 'fade',
         'wrapper' => 'mytable'
      )
   );

   $form['mytable'] = array(
      '#title' => t("Generated table"),
      '#prefix' => '<div id="mytable">',
      '#suffix' => '</div>',
      '#type' => 'fieldset',
      '#description' => t('This is where we get automatically generated table')
   );

   $form['submit'] = array(
      '#type' => 'submit',
      '#value' => t('Click Me')
   );
   return $form;
}

function listuserstable(){
   // make html for the table and rendering it
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.