Streaming live at 10am (PST)

Need form dropdown placeholder text not to be selectable?

When I create a drop down field in a form, I want there to be placeholder text that is NOT selectable.

However the only way I seem to be able to do this is to make the top option say, for example, ‘country’. It’s annoying as some people then choose ‘country’ as a value.

Share link please.

Hi Alex, thank you for the tip here - sorry I missed the alert to it!

Here is the link to the site that I’m having a problem on:

Hey Matthew,

Since you are using a common class for each of the dropdowns , Select-form , we could loop through all of them and disable the first option in each by placing this piece of code in the footer section (before </body>) of custom code;

  $( document ).ready(function() {
     $('.select-form').each( function () {
        $(this).children('option:first').attr("disabled", "disabled");

Let me know how this works for you.

Thank you so much for your extremely quick reply Alex!

Yes is is now fixed. I really appreciate it!

Great to know and you are very welcome… Enjoy.

1 Like

This topic was automatically closed 125 days after the last reply. New replies are no longer allowed.