I have a web form with name and email fields. when the form is submitted the name and email should store in database and an PDF file should start download.
my question is how to override the submit function of the web form so that i can add that extra function after that?
You will need to create a custom module with hook_form_alter() implementation.
The code above will execute your new callback function
YOUR_SUBMISSION_CALLBACK_FUNCTIONAFTER the form's default callback function.To make your new callback function called BEFORE the form's default callback function, use the following code instead of the giving above:
To cancel the form's default callback function and force it to use your function ONLY, use the code below
Hope this help.