My apologies if this is asked elsewhere -- I tried searching the forums but only got threads relating to the old AutocompleteField.
I want to append autocomplete="off" to one (or more) of my TextField()s but currently I have no idea how to do it and can't find any way to add arbituary attributes to any of the Form fields. Any tips?
Thanks a million!
Nathan J. Brauer
P.S. I'm new to SS/Saphire but I'm becoming a fan very quickly. Hopefully the community is as great as the framework :)
Sadly there is nothing in the FormField API for appending attributes. If you look at TextField::Field() you can see how tags are 'created' the form fields are currently still generated from the PHP for performance reasons.
Sure! If you plan on contributing it back to core follow the instructions on http://doc.silverstripe.org/sapphire/en/misc/contributing. You will need to fork the sapphire git repo so you can submit the changes easily.
In terms of what you need to change, I guess you need a couple functions for adding / removing / setting attributes and a map of attributes stored on each FormField (to replace the current hardcoded arrays)
Unit tests for this to be included in core is a must :)