Is there a way to create option groups on dropdown menus? e.g.
Is there a way to create option groups on dropdown menus? e.g.
Currently there's no way to do this within the form editor. You may be able to add the grouping using jQuery in your page template though.
yeah definitely, i was just wondering if i was missing a trick as i could find it, it's not essential at the moment anyway
I'm sure that's something we will add in the future. I do know it's been discussed around here as an option.
+1 for optgroup :)
+1 !
Indeed. Optgroup is a must feature for managing very long lists!
+1 indeed. It's only just popped up for me but, yes - would be very useful in the future. Thanks!
Optgroup is a feature we still plan on adding in the future. So it is on our to do list. We will never be done enhancing and refining Gravity Forms. There is no finish line.
Need optgroup ASAP!
Select State or Province
United States
-
-
-
Canada
-
-
-
It would be great to have this built-in, in the meantime you can accomplish it using a filter.
Add a drop down to your form but delete all but one of the options then save your form taking note of the form and field id's.
Next open up your themes functions file and paste in the following not forgetting to update the form and field ids to match the ones from your form and drop down. You will also want to edit the option values and labels (on line 5) and add in as many options and optgroups as you require.
+1 for optgroup!
I've been trying to use richardvav's method with no luck. I've got my form id and field id (1 & 7), but the dropdown only shows "First Choice". Has any one had any luck with getting option groups using this (or any other) method?
UPDATE:
The form & field id that is richardvav refers to is not the CSS id, but rather an id assigned by GForms that you can find in in the admin area (on your form, up towards the top of each field is the field id, and you can find the form id on the form settings page. It seems like a silly thing, but I had just assumed CSS id :).
Works great now that I've made that change. Thanks richardvav for sharing!