Form attributes added in block wrapper

Created on 20 March 2023, almost 2 years ago

Problem/Motivation

Steps to reproduce

- When I want to remove html5 validation, it will included in block wrapper rather than form tag

Proposed resolution

- Need to change line number 251 of build() of ContactBlock.php file
- From return $form; to return [$form];

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Active

Version

2.0

Component

Code

Created by

🇮🇳India pragna

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @pragna
  • 🇧🇬Bulgaria vuil Bulgaria 🇧🇬 🇪🇺 🌍
  • Status changed to Postponed: needs info over 1 year ago
  • 🇮🇳India samit.310@gmail.com

    HI @pragna,

    The resolution you proposed (From return $form; to return [$form];) will not work. As $form refers to The renderable form array representing the entire configuration form.

    Can you please elaborate more about this issue?

    Thanks
    Samit K.

  • 🇧🇬Bulgaria vuil Bulgaria 🇧🇬 🇪🇺 🌍

    @pragna
    Could you post the real issue? HTML5 validation or other.
    Then please describe each step to reproduce the same issue.
    Thank you.

  • 🇨🇺Cuba ramonma1989

    I encountered the same problem, i was trying to disable the html5 validation using a hook_form_alter

    function custommodule_form_alter(&$form, FormStateInterface $form_state, $form_id)
    {
    if ($form_id == 'contact_message_feedback_form') {
    $form['#attributes']['novalidate'] = '';
    }
    }

    but it dint work, and when i inspected the html code of the page i notice that the no validate atribute was been added to de div wrapping the form.

    I hope this helps.

Production build 0.71.5 2024