2

I have a problem with form. I would like to create checkboxes dynamically, based on the value from select type field. I have created AJAX callback function and in this function, I create a list and then return it to form.

my_ajax_callback($form, $form_state) {  
  $form['fieldset3']['service']["#title"] = 'new title';
  $form['fieldset3']['service']["#options"] = array('test1','test2');
  return $form['fieldset3']['service']["#options"];
}

This function sets the new title but doesn't create new options in that field. If I change the type to 'select' it works fine.

What am I missing here?

  • I'm having same problem, did you find any solution for it? – Sharique Nov 19 '13 at 12:21

Your Answer

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

Browse other questions tagged or ask your own question.