1

I received a pretty strange problem trying to customize custom form's template. So while form's template stay untouched (drupal core's form template was used) validation works just fine, but when I add some specific templates to my theme, validation just not working at all. Submitting a form just doesn't gives anything - MYMODULEFORM_form_validate and MYMODULEFORM_form_submit hooks are not called after form been submitted.

function MYTHEME_theme () { $items['MYMODULEFORM_1_form'] = array( 'render element' => 'form', 'path' => drupal_get_path('theme', 'MYTHEME') . '/templates', 'template' => 'template_1_filename', ); $items['MYMODULEFORM_2_form'] = array( 'render element' => 'form', 'path' => drupal_get_path('theme', 'MYTHEME') . '/templates', 'template' => 'template_2_filename', ); $items['MYMODULEFORM_3_form'] = array( 'render element' => 'form', 'path' => drupal_get_path('theme', 'MYTHEME') . '/templates', 'template' => 'template_3_filename', ); return $items; } 

When I print out $form variable inside the template file #validate and #submit elements are present and correct. Do you have any ideas what can cause this problem I just stucked at this. Thank you!

2
  • 4
    Do you have print drupal_render_children($form); at the bottom of the template file? Commented Jul 24, 2014 at 15:11
  • Now I have it! That You very much @Clive! Commented Jul 24, 2014 at 15:27

1 Answer 1

0

SOLUTION: Was only needed to add print drupal_render_children($form); at the bottom of the template file.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.