Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

getAttributesHTML arguments not being passed from template


Go to End


2 Posts   1072 Views

Avatar
prezet

Community Member, 6 Posts

29 December 2016 at 9:43pm

Using the $AttributesHTML template tag, I'm trying to pass some arguments across to filter out from attributes like so:

<input $AttributesHTML("class", "id") />

However it seems these are never being received by the FormField->getAttributesHTML method and the $attributes argument is always empty. I am using the userforms module, but I believe this just makes use of the built in form classes so no abstraction there.

Avatar
Kirk

Community Member, 67 Posts

4 January 2017 at 2:24pm

Maybe $Form is not defined try adding the $Debug variable to get more info

$Debug
<input $AttributesHTML("class", "id") />