Drupal load form with ajax callback in Bootstrap modal
I solved this issue differently by adding '#attribute' with event...

$form['share'] = array(
        '#type' =&gt; 'button',
        '#value' =&gt; "&lt;span class='glyphicon glyphicon-share-alt'&gt;&lt;/span&gt;&lt;span id=''&gt; " . t('Record') . "&lt;/span&gt;",
        '#ajax' =&gt; array(
          'callback' =&gt; "modal_share_form_submit", 
          'wrapper' =&gt; 'shareMessage',
          'effect' =&gt; 'fade',
          'method' =&gt; 'html'
        ),

        '#id' =&gt; 'modalsharebutton',
        '#attributes' =&gt; array('onclick' =&gt; "share_submit($fid);"),

);


Thank you.