Can we call submit handler of one form into another form?
I have two forms say user profile form and choose membership plan I want to unset submit function of choose membership plan and want to show in user profile form and also both forms field must save.
like multi-step form.
function myform_form_alter(&$form, &$form_state, $form_id) { if($form_id === "ms_membership_list_memberships_form") { $form['#validate'][] = "_myform_form_submit_handler"; } if($form_id === "user_profile_form") { $form['#validate'][] = "_myform_form2_submit_handler"; } } function _myform_form_submit_handler($form, &$form_state) { $form_state['rebuild'] = TRUE; $form_state['redirect'] = '/user/1/edit'; } function _myform_form2_submit_handler($form, &$form_state) { $form_state['rebuild'] = TRUE; $form_state['redirect'] = '/ms/checkout'; }
Sponsored by SupremePR