Need Country Names in Dropdown to be Static [RESOLVED]

Hi there. This will probably sound silly.

We would like “United States” and “Canada” to remain static and not be clickable in our drop-down menu. Is this possible? Below each are the given states and provinces.

I have searched for quite some time with no solution.

Any help would be appreciated.

Thank you

Layouts such as those are sometimes referred to as optgroup, something that is not supported in Gravity Forms at this time.

You could disable those choices in the dropdown using JavaScript or jQuery so they are not selectable.

Here’s an example of how to do it. The specifics will need to change for the actual values of your drop down (by ID or by value):

Hi Chris, thank you for getting back to me.

I was not able to get it working using the link you sent over. I did get to learn a little about optgroups though.

I did get it working using the available function here with instructions from another source.

After including the function I included ‘optgroup’ in the ‘value’ field next to the entries I needed to group.

Worked like a charm. Thank you for guiding me forward brother.

Super appreciated.

1 Like