Forked from RuZniki/drupal-8.form.reset-button.php
Last active
April 25, 2019 13:31
-
-
Save iberezovchuk/5b02ab1e24a7d82b61dabeba0b28199f to your computer and use it in GitHub Desktop.
Drupal 8 Adding a Reset Button to a form
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$form['actions']['reset'] = [ | |
'#type' => 'html_tag', | |
'#tag' => 'button', | |
'#value' => t('Cancel'), | |
'#attributes' => [ | |
'class' => ['btn', 'btn-default'], | |
'type' => 'reset', | |
], | |
]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment