Ajax Callback Function in Submit Button Doesnt Work I have a submit button in my form and I want to implement it using ajax:

function myid_user_page_form(){ 

   drupal_add_library('system', 'drupal.ajax');

   $form = array();

   $form['id'] = array(
       '#type' =&gt; 'fieldset',
       '#title' =&gt; t('ID Information'),
       '#prefix' =&gt; '&lt;div id="myid_search_id_number_wrapper"&gt;',
       '#suffix' =&gt; '&lt;/div&gt;'
   );  

   $form['submit'] = array(
      '#type' =&gt; 'button',
      '#value' =&gt; 'Save',   
      '#ajax' =&gt; array(
         'event' =&gt; 'click',
         'callback' =&gt; 'myid_user_page_form_ajax_submit',
         'wrapper' =&gt; 'myid_search_id_number_wrapper'
      ), 
      '#attributes' =&gt; array(
        'id' =&gt; 'myid_save',               
    ),
);

function myid_user_page_form_ajax_submit($form, &amp;$form_state) { 
    watchdog('Wow','Wow');
}


After executing the code above, the page still has it's refresh after it's clickfunctionality. The ajax doesnt work and no Wow message log in my watchdog table from my database, which means the ajax callback function isn't called. Where am I missing?
It is because you are changing the id attribute of the button.
The ajax in Drupal automatically attaches the javascript event listener to the submit, but it expects the button the have the automatically generated id.
Adding or changing the class attribute should not affect it though.  

All the suggestions TerryCB made in the comments are also valid.