---
title: "Form.submit ViewHelper <f:form.submit>"
manual: "Fluid ViewHelper Reference"
version: "14.3"
permalink: "https://docs.typo3.org/permalink/t3viewhelper:typo3-fluid-form-submit@14.3"
source: "Global/Form/Submit.rst"
rendered: "2026-10-01T16:43:06+00:00"
---

# Form.submit ViewHelper `<f:form.submit>` {#typo3-fluid-form-submit}

Creates a submit button (`<input type="submit"...>`) within a
[Form ViewHelper \<f:form>](https://docs.typo3.org/permalink/t3viewhelper:typo3-fluid-form@14.3).

> [!NOTE]
> If you you need a `<button>` with extended HTML content, use the
> [Form.button ViewHelper \<f:form.button>](https://docs.typo3.org/permalink/t3viewhelper:typo3-fluid-form-button@14.3)
> instead.

Go to the source code of this ViewHelper: [Form\\SubmitViewHelper.php (GitHub)](https://github.com/TYPO3/typo3/blob/main/typo3/sysext/fluid/Classes/ViewHelpers/Form/SubmitViewHelper.php).

**Table of contents**

-   [A Fluid form with a single submit button](https://docs.typo3.org/permalink/t3viewhelper:a-fluid-form-with-a-single-submit-button@14.3)
-   [A Fluid form with multiple submit buttons](https://docs.typo3.org/permalink/t3viewhelper:a-fluid-form-with-multiple-submit-buttons@14.3)
-   [Arguments of the form.submit ViewHelper](https://docs.typo3.org/permalink/t3viewhelper:arguments-of-the-form-submit-viewhelper@14.3)

## A Fluid form with a single submit button {#typo3-fluid-form-submit-example}

You can use the `<f:form.submit value="Submit!">` button within an Extbase
form to display a `<input type="submit" value="Submit!">` button.

When the user clicks the button, the action specified by the surrounding
[\<f:form>](https://docs.typo3.org/permalink/t3viewhelper:typo3-fluid-form@14.3)
is called.

**Fluid**

**packages/my_extension/Resources/Private/Templates/Comment/Edit.fluid.html**

```html
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers"
      data-namespace-typo3-fluid="true">
    <f:form action="submit" controller="Comment" objectName="comment" object="{comment}" method="post">
        <label for="tx-myextension-content">Message:</label>
        <f:form.textarea property="content" id="tx-myextension-content" rows="8" cols="46"/>
        <f:form.submit value="Submit"/>
    </f:form>
</html>

```

**Controller**

The controller action can then look like this:

**packages/my_extension/Classes/Controller/CommentController.php**

```php
<?php

declare(strict_types=1);

namespace MyVendor\MyExtension\Controller;

use MyVendor\MyExtension\Domain\Model\Comment;
use MyVendor\MyExtension\Domain\Repository\CommentRepository;
use Psr\Http\Message\ResponseInterface;
use TYPO3\CMS\Extbase\Mvc\Controller\ActionController;

class CommentController extends ActionController
{
  public function __construct(
    protected readonly CommentRepository $commentRepository,
  ) {}

  public function submitAction(Comment $comment): ResponseInterface
  {
    $this->commentRepository->update($comment);
    $this->addFlashMessage('Your comment was saved');
    return $this->redirect('show');
  }

  // Other actions
}

```

## A Fluid form with multiple submit buttons {#typo3-fluid-form-submit-example-multiple}

When you want to offer different actions, it can be helpful to use multiple
submit buttons with different labels:

**Fluid**

**packages/my_extension/Resources/Private/Templates/Comment/Edit.fluid.html**

```html
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers"
      data-namespace-typo3-fluid="true">
    <f:form action="submit" controller="MyController" objectName="comment" object="{comment}" method="post">
        <label for="tx-myextension-content">Message:</label>
        <f:form.textarea property="content" id="tx-myextension-content" rows="8" cols="46"/>
        <f:form.submit name="submitButton" value="Submit"/>
        <f:form.submit name="cancelButton" value="Cancel"/>
        <f:form.submit name="spellingButton" value="Check spelling"/>
    </f:form>
</html>

```

**Controller**

The controller action can then look like this:

**packages/my_extension/Classes/Controller/CommentController.php**

```php
<?php

declare(strict_types=1);

namespace MyVendor\MyExtension\Controller;

use MyVendor\MyExtension\Domain\Model\Comment;
use MyVendor\MyExtension\Domain\Repository\CommentRepository;
use Psr\Http\Message\ResponseInterface;
use TYPO3\CMS\Core\Type\ContextualFeedbackSeverity;
use TYPO3\CMS\Extbase\Mvc\Controller\ActionController;

class CommentController extends ActionController
{
  public function __construct(
    protected readonly CommentRepository $commentRepository,
  ) {}

  public function submitAction(
    Comment $comment,
    bool $cancelButton = false,
    bool $spellingButton = false,
  ): ResponseInterface {
    if ($cancelButton) {
      $this->addFlashMessage(
        'Your comment was NOT saved, you pressed the cancel button',
        'Attention',
        ContextualFeedbackSeverity::WARNING,
      );
      return $this->redirect('show');
    }
    if ($spellingButton) {
      if (!$this->mySpellCheckService->check($comment->getMessage())) {
        $this->addFlashMessage('There are spelling errors. ');
      }
      return $this->redirect('edit', null, null, ['comment' => $comment]);
    }
    // Form was submitted by submit button or for example by JavaScript
    $this->commentRepository->update($comment);
    $this->addFlashMessage('Your comment was saved');
    return $this->redirect('show');
  }

  // Other actions
}

```

> [!NOTE]
> All rendered buttons will be rendered as `<input type="submit"...>`.
> If you need a button with a different type than "submit", use the
> [Form.button ViewHelper \<f:form.button>](https://docs.typo3.org/permalink/t3viewhelper:typo3-fluid-form-button@14.3)
> instead.

## Arguments of the form.submit ViewHelper {#typo3-fluid-form-submit-arguments}

> **Allows arbitrary arguments**
>
> This ViewHelper allows you to pass arbitrary arguments not defined below
> directly to the HTML tag created. This includes custom `data-` arguments.

-   **additionalAttributes**

    -   *Type:* array

    Additional tag attributes. They will be added directly to the resulting HTML tag.

-   **aria**

    -   *Type:* array

    Additional aria-\* attributes. They will each be added with a "aria-" prefix.

-   **data**

    -   *Type:* array

    Additional data-\* attributes. They will each be added with a "data-" prefix.

-   **name**

    -   *Type:* string

    Name of input tag

-   **property**

    -   *Type:* string

    Name of Object Property. If used in conjunction with \<f:form object="...">, the "name" property will be ignored, while "value" can be used to specify a default field value instead of the object property value.

-   **value**

    -   *Type:* mixed

    Value of input tag
