I've created a Form using my module, which looks like this, then I've created a _validate & _submit handler (please see the linked file above). Then, in my front page, I printed the form using:
$form = drupal_get_form('mymodule_signin');
print render($form);
But when I'm submitting the form, the validate & submit handlers are not getting called, I'm getting redirected back to the front page. However, I created a submit button but when I was clicking it, the form was not getting submitted, so I submitted the form using jQuery's .submit()
method to submit the function!
Can anyone help me why the form was not getting submitted first time, and finally when it was submitted (using javascript) the handler was not getting called? Here goes the template file I used to render the form.
PS. I created an entry in the hook_menu()
and when I submit form using this page, the form gets submitted (calls validate handler). But it is not calling validate/submit handler when I submit it in my front page. :(
<?php print drupal_render($form['form_build_id']); print drupal_render($form['form_id']); print drupal_render($form['form_token']); ?>
This worked in 6 for me I cannot test it on 7drupal_render_children();
drupal_get_form()