Dont Refresh Drupal's Page after a button is click in Forms API
You should do something like this:

function myid_user_page_form() {
    $form = array();
    $form['id'] = array(
      '#type' =&gt; 'fieldset',
      '#title' =&gt; t('ID Information'),
      '#collapsible' =&gt; TRUE,
      '#collapsed' =&gt; FALSE,
    );
    $form['id']['myphoto_button'] = array(
      '#type' =&gt; 'button',
      '#value' =&gt; '...',
      '#attached' =&gt; array(
        'js' =&gt; drupal_get_path('module', 'your_module') . '/js/your_file.js'
      ),
    );
    return $form;
}


Then, add a directory "js" in your module and a js file. In that js file use:

(function ($) {
    Drupal.behaviors.yourModule = {
        attach: function (context, settings) {
            $('#your-element').click(function(e){
                e.preventDefault();

                // Your functionality.

                return false;
            });
        }
    };
})(jQuery);