On submission function is not being called in custom module I have written a custom module for form submission the first time but submit button is not working.

Here is the code:

function my_form($form, &amp;$form_state) {

$node = array();
$pl_name=array();
$pl_name=getplaylist_to_edit(arg(1));


$node['text'] = array(
'#type' =&gt; 'textfield',
'#id'=&gt;'edit-playlist-name',
'#value' =&gt; $pl_name[1],
);

$node['submit'] = array(
'#type' =&gt; 'submit',
'#value' =&gt; 'Update',
'#submit' =&gt; array('test'),
);

return $node;
}


function test()
{
echo '&lt;script&gt;alert("You have submitted the form.");&lt;/script&gt;';
}
Could you try like this:

function my_form($form, &amp;$form_state) {
  $pl_name=array();
  $pl_name=getplaylist_to_edit(arg(1));

  $form['text'] = array(
    '#type' =&gt; 'textfield',
    '#id'=&gt;'edit-playlist-name',
    '#value' =&gt; $pl_name[1],
  );

  $form['submit'] = array(
    '#type' =&gt; 'submit',
    '#value' =&gt; 'Update',
  );

  return $node;
}

function my_form_submit($form, &amp;$form_state){
  echo '&lt;script&gt;alert("You have submitted the form.");&lt;/script&gt;';
}