0

I work on submitting form via Drupal's Mail API. I want to pass all data with POST method. While I add this parameter to my form it disappear after rendering.

Before rendering:

<form method="post" action="{{ current_path }}">
  [...]
</form>

After rendering the method is removed:

<form action="http://localhost/drupal/contact" data-drupal-form-fields="">
  [...]
</form>

Is there any other approach to get the POST method instead of default which is GET?

  • How are you generating the form? Are you using the Form API? The default method is POST when using the Form API. Post your code. – mradcliffe Jul 26 '16 at 17:57
  • @mradcliffe From is written just in twig. It's not created programically. – El Danielo Jul 26 '16 at 18:05
  • Why are you not using Form API? – Kevin Jul 26 '16 at 19:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.