amforms
amforms copied to clipboard
Override autocomplete="off"
Would it be possible to override field settings like "autocomplete" when using "displayForm"?
Managing these setting via the CP for each field would be amazing, but even being able to pass a config object to "displayForm" and "displayField" would be great.
Then it would be rather something what we did with amnav, and parse in a config object.
We have nothing build in right now, that let's you edit the actual field. Only the field container.
I haven't used amnav, so don't know how that fits into this issues sorry.
What is the reason behind autocomplete being set to off by default on front end forms anyway? As far as I'm aware it's considered bad practice to remove autocomplete, especially from every field.
I see in "templates_display\templates_includes\forms\text.html" that it's set by this:
{%- if autocomplete is not defined or not autocomplete %} autocomplete="off"{% endif %}
I find it hard to understand the structure of the display templates with all the configs being passed into different macros etc, so I'm not sure where the 'autocomplete' variable (and others) might get set but...
As we are able to override the main field template, could a slight change be made so that we can override the settings in the config that is passed to the final input template via the macros?
So if I could put something like {% set autocomplete = true %}
in my field.twig override that would be great.
Note I use the fieldtype to allow editors to add amforms to a matrix block, so I can't use custom markup to do all this.
Thanks