3 namespace Drupal\form_test\Form;
5 use Drupal\Core\Form\FormBase;
6 use Drupal\Core\Form\FormStateInterface;
9 * Form constructor to test the #required property without #title.
13 class FormTestValidateRequiredNoTitleForm extends FormBase {
18 public function getFormId() {
19 return 'form_test_validate_required_form_no_title';
25 public function buildForm(array $form, FormStateInterface $form_state) {
26 $form['textfield'] = [
27 '#type' => 'textfield',
30 $form['actions'] = ['#type' => 'actions'];
31 $form['actions']['submit'] = ['#type' => 'submit', '#value' => 'Submit'];
38 public function submitForm(array &$form, FormStateInterface $form_state) {
39 drupal_set_message('The form_test_validate_required_form_no_title form was submitted successfully.');