How to set attributes like class, placeholder on form field on front-end?

lckamal - 2 months ago

Can we add class or set other attributes on the input? tried using setClass but input disappears after the change.

{% set form = form('register').get() %}
{{form.fields.email.setClass('selectpicker')}}

you can checkout this video for how to make module Forms for the Frontend: http://pyrocms.com/videos/series/module-development/module-forms-for-the-frontend

Answer

- 1 month ago

Looks like its answered here: http://pyrocms.com/forum/channels/field-types/add-attributes-to-input

lckamal - 1 month ago

Looks like its answered here: http://pyrocms.com/forum/channels/field-types/add-attributes-to-input