Title: CF7 smart grid &#8211; select data-* attributes
Last modified: November 1, 2021

---

# CF7 smart grid – select data-* attributes

 *  Resolved [oscarmoreta](https://wordpress.org/support/users/oscarmoreta/)
 * (@oscarmoreta)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/cf7-smart-grid-select-data-attributes/)
 * Hello
 * thanks again for the pluggin, it’s awesome
 * I have a question with attributes. I use select2 in several projects, normally
   I use data-* attributes in selects
 * <select class=”select2″ data-disabled-search=”1″ data-sample=”test”></select>
 * How can I include data-* attributes in a field based on dynamic dropdown
 * thanks
 * Oscar

Viewing 6 replies - 1 through 6 (of 6 total)

 *  Plugin Author [Aurovrata Venet](https://wordpress.org/support/users/aurovrata/)
 * (@aurovrata)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/cf7-smart-grid-select-data-attributes/#post-15029872)
 * may I ask what do you use these data attributes for?
 * if you use the CF7 dropdown menu tag field, then you ought to put your question
   on the CF7 plugin support page, as the `<select/>` html is being created by the
   CF7 plugin and not this plugin. This plugin just allows you to convert a dropdown
   menu to a select2 field.
 * If you need the data attributes for your select2 instantiation then I suggest
   you use the js custom options settings.
 * If you use use for your own custom scrits, then I suggest you put your data attributes
   on the parent element of your dropdown menu tag over which you have control.
 * If you are using a dynamic_dropdown tag, then you can use the filter hooks provided
   to add additional attributes to your HTML markup.
 *  Thread Starter [oscarmoreta](https://wordpress.org/support/users/oscarmoreta/)
 * (@oscarmoreta)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/cf7-smart-grid-select-data-attributes/#post-15034665)
 * Normally I use the data- * attributes to indicate in each instance of the select
   their configuration parameters, it’s very useful when in the same form I have
   several SELECT2 with different configuration options
 * with your helper cf7sgCustomHybridddTemplates I don’t need it
 * Thanks
 *  Plugin Author [Aurovrata Venet](https://wordpress.org/support/users/aurovrata/)
 * (@aurovrata)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/cf7-smart-grid-select-data-attributes/#post-15036116)
 * > Normally I use the data- * attributes to indicate in each instance of the select
   > their configuration parameters, it’s very useful when in the same form I have
   > several SELECT2 with different configuration options
 * agreed that’s a nice way to parametrise an instance. This is what I introduced
   on the HybridDropdown, the settings are in order of priority:
 * 1. HTML data-* attributes
    2. options passed in the constructor
 * so the cf7sgCustomHybridddTemplates are passed in the constructor (by the plugin)
   but should you use the php hooks to setup HTML data attributes on the field constructor,
   then these will override the values set in the js script.
 * This has the advantage of programmatically overriding default values you set 
   in your script.
 *  Plugin Author [Aurovrata Venet](https://wordpress.org/support/users/aurovrata/)
 * (@aurovrata)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/cf7-smart-grid-select-data-attributes/#post-15036118)
 * eres espanol?
 *  Thread Starter [oscarmoreta](https://wordpress.org/support/users/oscarmoreta/)
 * (@oscarmoreta)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/cf7-smart-grid-select-data-attributes/#post-15038697)
 * Yes, I am from Barcelona 🙂
 *  Plugin Author [Aurovrata Venet](https://wordpress.org/support/users/aurovrata/)
 * (@aurovrata)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/cf7-smart-grid-select-data-attributes/#post-15039693)
 * enhorabuena 🙂

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘CF7 smart grid – select data-* attributes’ is closed to new replies.

 * ![](https://ps.w.org/cf7-grid-layout/assets/icon-256x256.png?rev=1834229)
 * [Smart Grid-Layout Design for Contact Form 7](https://wordpress.org/plugins/cf7-grid-layout/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/cf7-grid-layout/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/cf7-grid-layout/)
 * [Active Topics](https://wordpress.org/support/plugin/cf7-grid-layout/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/cf7-grid-layout/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/cf7-grid-layout/reviews/)

## Tags

 * [dynamic dropdown](https://wordpress.org/support/topic-tag/dynamic-dropdown/)
 * [select2](https://wordpress.org/support/topic-tag/select2/)

 * 6 replies
 * 2 participants
 * Last reply from: [Aurovrata Venet](https://wordpress.org/support/users/aurovrata/)
 * Last activity: [4 years, 6 months ago](https://wordpress.org/support/topic/cf7-smart-grid-select-data-attributes/#post-15039693)
 * Status: resolved