Skip to content

Instantly share code, notes, and snippets.

@haroldSanchezb
Last active August 29, 2015 14:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save haroldSanchezb/7107c9851031fbbecacf to your computer and use it in GitHub Desktop.
Save haroldSanchezb/7107c9851031fbbecacf to your computer and use it in GitHub Desktop.
submit callback
<?php
$form['filters']['button'] = array(
// '#weight' => '4',
'#type' => 'button',
'#value' => t('Filtrar'),
'#ajax' => array(
'callback' => 'custom_ajax_submit',
'wrapper' => 'id',
'method' => 'replace',
),
);
function custom_ajax_submit(&$form, &$form_state) {
return array(
'#type' => 'ajax',
'#commands' => array(
ajax_command_replace("#id", 'cambios'),
)
);
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment