Is it possible to show an image depending on which checkbox is ticked?

I've got a couple of custom fields set up in CustomPress which go to a custom post type.

I was wondering if it's possible to show an image for each box that is ticked, like a logo or icon?

The idea is for the users to have a list of shops in their backend listing and for them to tick all the ones they buy from, then on the front end the shop logo or icon is displayed rather than the name.

Any ideas?

Many thanks

  • Sajid

    Hi Vic,
    Hope you are doing good today :slight_smile:

    This is a good idea but I am afraid we don't support icons fields at the moment. There are only standard fields that are available to be used.

    Its unlikely that we will develop this feature but I am still moving it to features and feedback section. If it gets enough +1's/votes from other members of community then it can be considered for development.

    If you want this feature right now then you have to code it yourself if you know PHP otherwise need to get professional assistance from jobs board.

    Take care and have a nice day :slight_smile:

    Best Regards,
    Sajid

  • Nastia

    Hello Vic

    I hope you are doing well today!

    Once you create a checkbox field, the field ID will be shown in the Custom Fields list ( in Custom Press > Content Types > Custom Fields )

    Please see the screenshot:

    Also, is it possible to add a textbox to the checkboxes for 'other' or would this need another custom field as other which is shown under the checkbox?

    I am afraid this is not possible, you need to create another custom field for this option.

    I hope this helps!

    Cheers,
    Nastia

  • Vic

    Hi Nastia,

    Thanks for the reply - I wasn't very clear I'm afraid, I know where the field IDs are for embedding, what I need are the Option ID's - so if I have say 3 options on the check box for say, red, yellow or blue, how would I find the ID of 'blue' if someone ticks it, or 'red' if they tick that? Ultimately I want to be able to show an image/logo for each option which I found some code for doing this but I would need each option to have it's own ID so the code would know when to display the image.

    Many thanks

    Vic

  • Sajid

    Hi Vic,
    Hope you are doing good today :slight_smile:

    You have select tag or different checkboxes ?

    If its select, then you can do this by getting the value or option name of the select box using jQuery onChange event.

    If these are checkboxes, then you might need to create each field separately for each option and should have the ID of that box like mentioned by Nastia above.

    Hope that helps! Feel free to post a reply if you need further assistance :slight_smile:

    Best Regards,
    Sajid