I need to add a button to an exposed views form that is available for logged-in users. This button should perform some actions via AJAX when clicked. The form has AJAX enabled.
I used the following
$form['custom-ajax'] = array( '#type' => 'button', '#value' => 'test', '#value' => 'Do Something', '#submit' => array('submit_array_2'), '#ajax' => array( 'callback' => 'my_module_do_something', 'event' => 'mouseup', 'wrapper' => 'wrapper', ) );
It renders the button correctly but a couple things happen. The AJAX throbber for the views starts spinning on page load and doesn't stop and when the added button is clicked I get a 404 with a path targeting
I've tried to change the
url attribute of the AJAX call but haven't had any luck.
What am I doing wrong?