I want to create a ctools modal popup when a button is pressed.
function custom_form( $form, &form_state ) {
$form['btn'] = array(
'#type' => 'button',
'#value' => t('add'),
'#executes_submit_callback' => FALSE,
'#ajax' => array(
'callback' => 'custom_callback',
),
);
}
function custom_callback() {
ctools_include('ajax');
ctools_include('modal');
ctools_modal_render( 'Error', 'Error Message');
}
I only get the alert message with the un-rendered ajax response. How can get I this response displayed in rendered format in modal?