Jump to content

Recommended Posts

Posted

I'm using a Select Option field for a user to select a color by name. In the back-end the radio buttons are showing the title of the color but the actual value (the Hex) can't be traced using the Inspector. Is there a way to hook into the Radio input field to add the Hex value if one is selected? I'd like to add the selected color to the background of the field after save.

Posted

The only thing I know about hooks is to catch fish. ? You might take a look at @kixe's module color field to see how it was done there.

Another option, if you have a limited selection is to use individual pages for each color.

  • Like 1
Posted
On 5/4/2020 at 5:02 PM, ttttim said:

Or is there a simple way to disable the JS colorpicker from https://modules.processwire.com/modules/fieldtype-color-picker/?

With FieldtypeColor https://modules.processwire.com/modules/fieldtype-color/ you have multiple options for the Inputfield:
Text, HTML5 Color, any Javascript ...

If you are able to create a custom SQL table for your colors FieldtypeSelectExtOption https://modules.processwire.com/modules/fieldtype-select-ext-option/ is a possible solution for your needs, since you can use the hex code as the value here.

 

 

  • Like 1
  • 2 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...