How to add a function to web form submit button? On a Drupal site, when a form submission is done. I need to trigger a SMS. I am unable to edit the form submit code. Please let me know how to add a function to webform submit button. So that on SUBMIT button click the SMS function get executed as well the form data goes to the database.
Your mileage will vary, but it's the same as adding submit handlers to any form:

function MYMODULE_form_alter(&amp;$form, &amp;$form_state, $form_id) {
  if ($form_id == 'foo') {
    $form['actions']['submit']['#submit'][] = 'MYMODULE_some_function';
  }
}

function MYMODULE_some_function($form, &amp;$form_state) {
  // Do something...
}


See hook_form_alter() for full details.