I'm stuck because whatever I do my wrapper is never filled with my callback, any idea ?
$form['show_liste_produits'] = array(
'#type' => 'button',
//'#attributes' => array('onclick' => 'return (false);'),
'#value' => t('Lister les produits'),
'#name' => 'awesome-button',
'#ajax' => array(
'callback' => 'stockerAll',
'wrapper' => 'listeProduits',
'method' => 'replace',
'effect' => 'fade',
),
);
$form['listeProduits'] = array(
'#type' => 'container',
'#attributes' => array(
'id' => array('listeProduits'),
),
);
function stockerAll($form, $form_state){
return 'test';
}
Thank you in advance !
EDIT: In fact in the network tab I get this, maybe the selector isn't working ? Moreover, my empty container isn't displayed after page load actually, maybe is it the source of the problem ?