Using Theme() to output html/javascript in user edit I have a module that outputs a button to the user edit page. I use the form_user_profile_form_alter to append the button but I want to add html and javascript after it. I saw that the theme() function can do this but my attempt does not add any html. Also I saw that the theme needs two parameters but I do not know what the 1st parameter is supposed to be. I was only following examples.

function myModule_form_user_profile_form_alter(&amp;$form, &amp;$form_state, $form_id) {

  $form['actions']['myButton'] = array(
    '#type' =&gt; 'submit',
    '#value' =&gt; 'Click Here'
  );
  $form['actions']['myButton']['#submit'][] = 'myModule_callback';

  return $form;
}


Here is my callback function

function artsci_pubmed_biblio_callback($form,$form_state){
  drupal_set_message('Button Clicked');
  return theme('box', '&lt;li&gt;Item 1&lt;/li&gt;&lt;li&gt;Item 2&lt;/li&gt;&lt;li&gt;Item 3&lt;/li&gt;');
}
If you just want to add some markup and Javascript, you don't need a submit callback because that's for handling form submissions.

Requirement 1: Add html

Options:


#prefix and/or #suffix form element attributes. (If just simple short html this will do)
#theme to use you custom theme function declared hook_theme and place your markup in your tpl.php file. (If too much markup and want your module/theme to be clean)


Requirement 2: Add javascript

You can use #attached form/form element attribute

In the links, there are example codes that you can follow.