0

I'm trying figure out, how I can disable auto-fill or change markup of 'user' and 'e-mail' input forms, when a user is logged in.

This auto-fill feature is breaking my design, because the 'user' and 'e-mail' markup are just a text inside a div and I can't apply a correct style on it.

Feedback form

0

Something in the core stores user login and drupal use this information in every form submit, in other lines, I can't let user change 'user' and 'e-mail' inputs. BUT, I found how to change markup and correct my design. Follow...

In 'mytemplate'\templates\form\form-element.html.twig I changed:

...[omitted]...

78.   {{children}}

...[omitted]...

for:

{% if logged_in and element['#type'] == 'item' %}
  <input type="text" name="{{name}}" value="{{element['#value']}}" disabled>
{% else %}
  {{ children }}
{% endif %}

And my form now looks like this: enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.