If you want full control over the ID you're a bit outta luck for 3.* - https://github.com/silverstripe/silverstripe-framework/blob/3.1/forms/FormField.php#L164. You could create a Subclass of FormField and override the ID method as normal inheritance. I've made this customisable in 3.2 (master / unreleased) along with other improvements to the Form ID generation - https://github.com/silverstripe/silverstripe-framework/commit/ca87b8b79496a78454d63c225f1f4f38fa55a150
Posted to: Giving a HiddenField (or any other field) a custom id attribute | Show Thread | Post Reply