Hot answers tagged

1

This: (isset($values['element1'])) will always return TRUE, since the form element exists, and therefore a value is always passed to the submit hander, even when the value is empty. You likely want this: !empty($values['element1'])


1

After examining the ViewAjaxController.php ajaxView() function, I came up with the following solution, which seems functioning for me. I created an ajax endpoint which extends ViewAjaxController and sets the requested view and display in the Request object then calls the parent ajaxView() method. 1. Define the route my_module.routing.yml my_module....


1

To get a triggering element you must provide a unique '#name' for each button. Additionally, you can specify parameters to identify the action and record function example_form($form, &$form_state){ $form['groups'] = array( '#tree' => TRUE, ); foreach(array(5,4,8,10) AS $id){ $form['groups'][$id] = array( 'id' ...


Only top voted, non community-wiki answers of a minimum length are eligible