Home › Forums › General Issues › Disabling click on Color picker?
Hello good people,
Is it possible to disable click on color picker?
I’m asking this because I have radio buttons that define what color style user want to show on a page, and color picker is just to show visually color of the style. That is why I need to disable click on color picker.
If there us some delicate way to do this, I’m open to suggestions 😉
If you already have a radio button that allows picking of specific colors, you can alter the radio field to show those colors by including HTML in the “label” portion and then you can add custom CSS to your admin to style that HTML to show the correct color,
or you can even add they styling inline. For example, I used something like this on a site to display a block of color around the label that shows the color being selected.
#f5f5f5 : <span style="display: inline-block; padding: 0 2px; background-color: #f5f5f5; color: #191919;">Light (#f5f5f5)</span> #191919 : <span style="display: inline-block; padding: 0 2px; background-color: #191919; color: #FFF;">Dark (#191919)</span> site_colors_company : <span style="display: inline-block; padding: 0 2px; background-color: #006fb6; color: #FFF; font-weight: bold;">company</span> site_colors_company_2 : <span style="display: inline-block; padding: 0 2px; background-color: #99cc00; color: #FFF; font-weight: bold;">company 2</span> site_colors_cta : <span style="display: inline-block; padding: 0 2px; background-color: #ff7f00; color: #FFF; font-weight: bold;">CTA</span>
You can probably even do away with the text and just show a block of color, there are a lot of possibilities here.
Thank you for long answer, i will investigate possible solution on this topic and will return to say my result 😉
Differently you show me the path 😀
@soullighter Did you find a solution to this by any chance ?
Sadly no, client agree that color picker is just to show picked color by select field 😀
Damn, was hoping you had a way… Disabling text inputs is no prob but this color thing…
Adding a class hidden (which is display: none) doesn’t seem to work either (for me).
Yep, I had no time to investigate, and the client just didn’t want to pay extra money for this, so I give up.
You must be logged in to reply to this topic.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
CPT registration is coming to ACF! We demoed the new feature during the most recent session of ACF Chat Fridays. Check out the summary for the details. https://t.co/k2KQ3WWBAz— Advanced Custom Fields (@wp_acf) March 7, 2023
© 2023 Advanced Custom Fields.