Hello everyone,

I am using hook_form_FORM_ID_alter() to add additional form fields to collect user data. The form elements are showing up nicely, but how am I supposed to save the values of the form now.

I am adding fields to block add/configure forms (note node add/edit form).

Thanks.

Comments

nevets’s picture

As part of your code you want to add something like

  $form['#submit'][] = 'yourmodule_somename_submit';

Where 'yourmodule_somename_submit' is a valid function name in your module. Function would be declared like

yourmodule_somename_submit($form, $form_state) {
}
uzbekjon’s picture

Thanks Nevets, it worked!