Cover of the book Symfony 5: The Fast Track

Symfony 5: The Fast Track is the best book to learn modern Symfony development, from zero to production. +300 pages showcasing Symfony with Docker, APIs, queues & async tasks, Webpack, SPAs, etc.

WARNING: You are browsing the documentation for Symfony 2.8 which is not maintained anymore. Consider upgrading your projects to Symfony 5.1.

ResetType Field

ResetType Field

New in version 2.3: The ResetType was introduced in Symfony 2.3.

A button that resets all fields to their original values.

Rendered as input reset tag
Inherited options
Parent type ButtonType
Class Symfony\Component\Form\Extension\Core\Type\ResetType

Inherited Options


type: array default: array()

If you want to add extra attributes to the HTML representation of the button, you can use attr option. It’s an associative array with HTML attribute as a key. This can be useful when you need to set a custom class for the button:

use Symfony\Component\Form\Extension\Core\Type\ResetType;
// ...

$builder->add('save', ResetType::class, array(
    'attr' => array('class' => 'save'),


type: boolean default: false

If you don’t want a user to be able to click a button, you can set the disabled option to true. It will not be possible to submit the form with this button, not even when bypassing the browser and sending a request manually, for example with cURL.


type: string default: The label is “guessed” from the field name

Sets the label that will be displayed on the button. The label can also be directly set inside the template:

  • Twig
    {{ form_widget(, { 'label': 'Click me' }) }}
  • PHP
    <?php echo $view['form']->widget($form['save'], array('label' => 'Click me')) ?>


type: string default: messages

This is the translation domain that will be used for any labels or options that are rendered for this button.

This work, including the code samples, is licensed under a Creative Commons BY-SA 3.0 license.