Skip Navigation

[Resolved] ReadOnly on select fields

This support ticket is created 7 years, 3 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 5 replies, has 2 voices.

Last updated by romanB-3 7 years, 3 months ago.

Assisted by: Shane.

Author
Posts
#556656

Hello,
I am trying to set some select fields as readonly.
The property readonly works great for text fields, but the user still can change the value of the select when it's on readonly.
Thank you.

#556690

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Roman,

Thank you for contacting our support forum.

Actually readonly for Select tags you will need it to be set to disabled.

Is there a way I can have a look at the form to provide you with the code to do this ?

Thanks,
Shane

#557789

Yes thank you ; please activate private fields so I can give you the URL.

#557809

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Private fields

#557849

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Roman,

I've added the following code to your form and the items should now be disabled.

jQuery( document ).ready(function() {
jQuery('.disabled-selects select').prop('disabled', true);
});

Thanks,
Shane

#557852

Thank you very much !