0

How do I set custom form attributes for {exp:channel:form} tag?

I want to set this attribute role="form"

1

This plugin does that, but I don't think it supports the role param. It would be real easy to add though.

https://github.com/jazonv/SafeCracker-HTML5-Attributes

4
  • I will just fork it to add my own attributes. Thanks! Oct 11 '13 at 1:42
  • This doesn't seem to work for Channel Forms unfortunately - the channel forms library doesn't contain the EE global (as the Safecracker library did), so it fails. Feb 8 '14 at 15:58
  • That's not likely the cause. The EE global is still used, but it's not assigned to the $this->EE property. I haven't tested it to what is wrong, but it could easily be fixed. Feb 8 '14 at 22:25
  • Yes, on doing some more investigation that's not the cause. However, just changing the hook to 'channel_form_entry_form_tagdata_end' doesn't work. This line generates the error: $params = $this->obj->EE->TMPL->tagparams; - I assumed that the problem was referencing EE as part of the CF object, but I'm not sure how to fix the issue Feb 10 '14 at 9:40
0

If you are using Channel Forms (EE 2.7+), than this should work for you: https://github.com/tobystokes/EE-SafeCracker-HTML5-Attributes

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.