Hello I have created a custom form added a # ajax callback on form submit
$form['hotel_book_form']['submit'] = array(
'#type' => 'submit',
'#value' => t('Check Availability'),
'#ajax' => array(
'callback' => "list_rooms",
'wrapper' => "replace_hotelbook_div",
'method' => 'replace',
'effect' => 'fade',
),
);
and I have added this wrapper as suffix to the form
$form['hotel_book_form'] = array(
'#type' => 'fieldset',
'#title' => t('Book Hotel'),
'#weight' => 5,
'#collapsible' => TRUE,
'#collapsed' => FALSE,
'#prefix' => '<div id="replace_hotelbook_div"></div>',
);
but when I click on form's submit button the page gets simply reloaded and the ajax callback function does not fire.