3 namespace Drupal\form_test\Form;
5 use Drupal\Core\Form\FormBase;
6 use Drupal\Core\Form\FormStateInterface;
9 * Builds a form to test the placeholder attribute.
11 class FormTestPlaceholderForm extends FormBase {
16 public function getFormId() {
17 return 'form_test_placeholder_test';
23 public function buildForm(array $form, FormStateInterface $form_state) {
24 foreach (['textfield', 'textarea', 'url', 'password', 'search', 'tel', 'email', 'number'] as $type) {
28 '#placeholder' => 'placeholder-text',
38 public function submitForm(array &$form, FormStateInterface $form_state) {