[Skip to main content](#vessel-content)

#   Characteristics Selection Radio Button

##

- **[MyWorld](/forum/user/862-myworld "View MyWorld's Profile")**
- [![MyWorld's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/862-myworld "View MyWorld's Profile") Topic Author
- [ Offline](/forum/user/862-myworld)

Less More

- Posts: 966
- Thank you received: 11
-
-

6 years 4 months ago [\#321641](#321641) by [MyWorld](/forum/user/862-myworld "View MyWorld's Profile")  *[Characteristics Selection Radio Button](/forum/26-product-category-display/900341-characteristics-selection-radio-button#321641 "-- HikaShop version -- : 4.3.0  I am using the radio button as the option to select a product size. I have the below CSS on my label on hover and it works fine.  I want the background colour to be the same as the hover colour when the size/button is selected. No matter what I try to get an active background color it does not work - and I've tried a lot of options.  So, I'm wondering before I waste anymore time, is this just not possible to do?  I've attached a screenshot of the button code.  Thanks!")* was created by *[MyWorld](/forum/user/862-myworld "View MyWorld's Profile")*

-- HikaShop version -- : 4.3.0

I am using the radio button as the option to select a product size. I have the below CSS on my label on hover and it works fine.
Code:

\#hikashop_product_characteristics div.controls label:hover { color: #ffffff; background-color: #196691; }

I want the background colour to be the same as the hover colour when the size/button is selected. No matter what I try to get an active background color it does not work - and I've tried a lot of options.

So, I'm wondering before I waste anymore time, is this just not possible to do?

I've attached a screenshot of the button code.

[ ![radio-button.jpg](/forum/attachment/49947) ](/forum/attachment/49947 "radio-button.jpg")

Thanks!

- [ ![radio-button.jpg](/forum/attachment/49947) ](/forum/attachment/49947 "radio-button.jpg") [ ](/forum/attachment/49947?download=1 "radio-button.jpg")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS85MDAzNDEtY2hhcmFjdGVyaXN0aWNzLXNlbGVjdGlvbi1yYWRpby1idXR0b24/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Philip](/forum/user/34318-philip "View Philip's Profile")**
- [![Philip's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/34318-philip "View Philip's Profile")
- [ Offline](/forum/user/34318-philip)

Less More

- Posts: 4820
- Thank you received: 652
-
-

6 years 4 months ago -  6 years 4 months ago [\#321750](#321750) by [Philip](/forum/user/34318-philip "View Philip's Profile")  Replied by *[Philip](/forum/user/34318-philip "View Philip's Profile")* on topic *[Characteristics Selection Radio Button](/forum/26-product-category-display/900341-characteristics-selection-radio-button#321750 "-- HikaShop version -- : 4.3.0  I am using the radio button as the option to select a product size. I have the below CSS on my label on hover and it works fine.  I want the background colour to be the same as the hover colour when the size/button is selected. No matter what I try to get an active background color it does not work - and I've tried a lot of options.  So, I'm wondering before I waste anymore time, is this just not possible to do?  I've attached a screenshot of the button code.  Thanks!")*

Hello,

I'm afraid that only **Css** won't be enough to be able to add style on label from your input condition.
I detail my idea through this pseudo code : Code:

&lt;label class="parent"&gt; &lt;input class="child" checked="checked"&gt;

so far there are **no Css command** to create a selector that start from child with "***checked***" state to **select his parent**.

The only solution, is to add **Javacript** to add some class to your label, and so this require more development skills.
Sorry for this return but we didn't see other way to proceed.

Regards

Last edit: 6 years 4 months ago by [Philip](/forum/user/34318-philip "View Philip's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS85MDAzNDEtY2hhcmFjdGVyaXN0aWNzLXNlbGVjdGlvbi1yYWRpby1idXR0b24/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[MyWorld](/forum/user/862-myworld "View MyWorld's Profile")**
- [![MyWorld's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/862-myworld "View MyWorld's Profile") Topic Author
- [ Offline](/forum/user/862-myworld)

Less More

- Posts: 966
- Thank you received: 11
-
-

6 years 4 months ago [\#321827](#321827) by [MyWorld](/forum/user/862-myworld "View MyWorld's Profile")  Replied by *[MyWorld](/forum/user/862-myworld "View MyWorld's Profile")* on topic *[Characteristics Selection Radio Button](/forum/26-product-category-display/900341-characteristics-selection-radio-button#321827 "-- HikaShop version -- : 4.3.0  I am using the radio button as the option to select a product size. I have the below CSS on my label on hover and it works fine.  I want the background colour to be the same as the hover colour when the size/button is selected. No matter what I try to get an active background color it does not work - and I've tried a lot of options.  So, I'm wondering before I waste anymore time, is this just not possible to do?  I've attached a screenshot of the button code.  Thanks!")*

Thanks Philip.

Is it not possible to add a class to the label in display &gt; views?

Thanks!

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS85MDAzNDEtY2hhcmFjdGVyaXN0aWNzLXNlbGVjdGlvbi1yYWRpby1idXR0b24/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Philip](/forum/user/34318-philip "View Philip's Profile")**
- [![Philip's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/34318-philip "View Philip's Profile")
- [ Offline](/forum/user/34318-philip)

Less More

- Posts: 4820
- Thank you received: 652
-
-

6 years 4 months ago -  6 years 4 months ago [\#321844](#321844) by [Philip](/forum/user/34318-philip "View Philip's Profile")  Replied by *[Philip](/forum/user/34318-philip "View Philip's Profile")* on topic *[Characteristics Selection Radio Button](/forum/26-product-category-display/900341-characteristics-selection-radio-button#321844 "-- HikaShop version -- : 4.3.0  I am using the radio button as the option to select a product size. I have the below CSS on my label on hover and it works fine.  I want the background colour to be the same as the hover colour when the size/button is selected. No matter what I try to get an active background color it does not work - and I've tried a lot of options.  So, I'm wondering before I waste anymore time, is this just not possible to do?  I've attached a screenshot of the button code.  Thanks!")*

Hello,

Through an override view, yes it's possible to add a class, but you want add class dynamically : Code:

&lt;label class="parent parentChecked"&gt; &lt;input class="child" checked="checked"&gt;

And : Code:

&lt;label class="parent"&gt; &lt;input class="child" checked="checked"&gt;

With this kind of css : Code:

label.parentChecked { background-color: blue; }

That's why you need some javascript to **add**/**remove** specific class in order to apply (or not) your Css.
Hope this will help you to progress on this subject.
Regards

Last edit: 6 years 4 months ago by [Philip](/forum/user/34318-philip "View Philip's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS85MDAzNDEtY2hhcmFjdGVyaXN0aWNzLXNlbGVjdGlvbi1yYWRpby1idXR0b24/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[MyWorld](/forum/user/862-myworld "View MyWorld's Profile")**
- [![MyWorld's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/862-myworld "View MyWorld's Profile") Topic Author
- [ Offline](/forum/user/862-myworld)

Less More

- Posts: 966
- Thank you received: 11
-
-

6 years 4 months ago [\#322424](#322424) by [MyWorld](/forum/user/862-myworld "View MyWorld's Profile")  Replied by *[MyWorld](/forum/user/862-myworld "View MyWorld's Profile")* on topic *[Characteristics Selection Radio Button](/forum/26-product-category-display/900341-characteristics-selection-radio-button#322424 "-- HikaShop version -- : 4.3.0  I am using the radio button as the option to select a product size. I have the below CSS on my label on hover and it works fine.  I want the background colour to be the same as the hover colour when the size/button is selected. No matter what I try to get an active background color it does not work - and I've tried a lot of options.  So, I'm wondering before I waste anymore time, is this just not possible to do?  I've attached a screenshot of the button code.  Thanks!")*

Can this be added as a feature/improvement to Hikashop going forward?

Thanks!

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS85MDAzNDEtY2hhcmFjdGVyaXN0aWNzLXNlbGVjdGlvbi1yYWRpby1idXR0b24/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[kaurovs](/forum/user/57689-kaurovs "View kaurovs's Profile")**
- [![kaurovs's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/57689-kaurovs "View kaurovs's Profile")
- [ Offline](/forum/user/57689-kaurovs)

Less More

- Posts: 6
- Thank you received: 0
-
-

6 years 1 month ago -  6 years 1 month ago [\#324856](#324856) by [kaurovs](/forum/user/57689-kaurovs "View kaurovs's Profile")  Replied by *[kaurovs](/forum/user/57689-kaurovs "View kaurovs's Profile")* on topic *[Characteristics Selection Radio Button](/forum/26-product-category-display/900341-characteristics-selection-radio-button#324856 "-- HikaShop version -- : 4.3.0  I am using the radio button as the option to select a product size. I have the below CSS on my label on hover and it works fine.  I want the background colour to be the same as the hover colour when the size/button is selected. No matter what I try to get an active background color it does not work - and I've tried a lot of options.  So, I'm wondering before I waste anymore time, is this just not possible to do?  I've attached a screenshot of the button code.  Thanks!")*

Hi, Philip!

I'm struggling with same problem right now. I think that good workaround cloud be change of html output from
Code:

&lt;label&gt; &lt;input type="radio"&gt; VARIANT OPTION &lt;/label&gt;

to Code:

&lt;div&gt; &lt;label&gt;VARIANT OPTION&lt;/label&gt; &lt;input type="radio"&gt; &lt;/div&gt;

and adding just this CSS line:
Code:

input[type="radio"]:checked+label { font-weight: bold; }

Is there way to change this part of output via 'views' editor? I tried to trace where this output generates but unfortunately unsuccessfully. Please let me know if this presumption could work.

BR,
Arturs

Last edit: 6 years 1 month ago by [kaurovs](/forum/user/57689-kaurovs "View kaurovs's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS85MDAzNDEtY2hhcmFjdGVyaXN0aWNzLXNlbGVjdGlvbi1yYWRpby1idXR0b24/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Philip](/forum/user/34318-philip "View Philip's Profile")**
- [![Philip's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/34318-philip "View Philip's Profile")
- [ Offline](/forum/user/34318-philip)

Less More

- Posts: 4820
- Thank you received: 652
-
-

6 years 1 month ago -  6 years 1 month ago [\#324870](#324870) by [Philip](/forum/user/34318-philip "View Philip's Profile")  Replied by *[Philip](/forum/user/34318-philip "View Philip's Profile")* on topic *[Characteristics Selection Radio Button](/forum/26-product-category-display/900341-characteristics-selection-radio-button#324870 "-- HikaShop version -- : 4.3.0  I am using the radio button as the option to select a product size. I have the below CSS on my label on hover and it works fine.  I want the background colour to be the same as the hover colour when the size/button is selected. No matter what I try to get an active background color it does not work - and I've tried a lot of options.  So, I'm wondering before I waste anymore time, is this just not possible to do?  I've attached a screenshot of the button code.  Thanks!")*

Hello,

In order to better understand the context, and mostly better answer you can you provide an **Url** in order to see the page.
And little tips, you have a specific option to guide you to find HikaShop View , from **Main HikaShop Configuration** and go to **Advanced** tab, then first part "**Advanced settings**", active your "**Display view files**" option on "**Front**"
[ ![alt](https://i.imgur.com/zZp5w1S.png) ](https://i.imgur.com/zZp5w1S.png "alt")

Awaiting news from you to progress on your subject.
Regards

Last edit: 6 years 1 month ago by [Philip](/forum/user/34318-philip "View Philip's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS85MDAzNDEtY2hhcmFjdGVyaXN0aWNzLXNlbGVjdGlvbi1yYWRpby1idXR0b24/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[kaurovs](/forum/user/57689-kaurovs "View kaurovs's Profile")**
- [![kaurovs's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/57689-kaurovs "View kaurovs's Profile")
- [ Offline](/forum/user/57689-kaurovs)

Less More

- Posts: 6
- Thank you received: 0
-
-

6 years 1 month ago -  6 years 1 month ago [\#324904](#324904) by [kaurovs](/forum/user/57689-kaurovs "View kaurovs's Profile")  Replied by *[kaurovs](/forum/user/57689-kaurovs "View kaurovs's Profile")* on topic *[Characteristics Selection Radio Button](/forum/26-product-category-display/900341-characteristics-selection-radio-button#324904 "-- HikaShop version -- : 4.3.0  I am using the radio button as the option to select a product size. I have the below CSS on my label on hover and it works fine.  I want the background colour to be the same as the hover colour when the size/button is selected. No matter what I try to get an active background color it does not work - and I've tried a lot of options.  So, I'm wondering before I waste anymore time, is this just not possible to do?  I've attached a screenshot of the button code.  Thanks!")*

Hi,

thanks for showing '**Display view files**' feature. This leads me to **show\_block\_characteristic.php**. Now I'm stuck again because code there is to complex for me.

Here is url to product.
[ vaidava.lv/lv/davanu-karte](https://vaidava.lv/lv/davanu-karte)

This will be a gift card. The thing that I want to do is to change style of selected value of gift card.

BR,
Arturs

Last edit: 6 years 1 month ago by [kaurovs](/forum/user/57689-kaurovs "View kaurovs's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS85MDAzNDEtY2hhcmFjdGVyaXN0aWNzLXNlbGVjdGlvbi1yYWRpby1idXR0b24/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Philip](/forum/user/34318-philip "View Philip's Profile")**
- [![Philip's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/34318-philip "View Philip's Profile")
- [ Offline](/forum/user/34318-philip)

Less More

- Posts: 4820
- Thank you received: 652
-
-

6 years 1 month ago -  6 years 1 month ago [\#324910](#324910) by [Philip](/forum/user/34318-philip "View Philip's Profile")  Replied by *[Philip](/forum/user/34318-philip "View Philip's Profile")* on topic *[Characteristics Selection Radio Button](/forum/26-product-category-display/900341-characteristics-selection-radio-button#324910 "-- HikaShop version -- : 4.3.0  I am using the radio button as the option to select a product size. I have the below CSS on my label on hover and it works fine.  I want the background colour to be the same as the hover colour when the size/button is selected. No matter what I try to get an active background color it does not work - and I've tried a lot of options.  So, I'm wondering before I waste anymore time, is this just not possible to do?  I've attached a screenshot of the button code.  Thanks!")*

Hello,

We will need more elements to better understand what do you mean by "***I'm stuck again because code there is to complex for me***".
In order to be clear, the HikaShop team can guide you but we have to understand where is your current issue.

From what we know, you have now to add some **javascript** (and not necessarily in the "sub-view" **show\_block\_characteristic**) in the main **show\_default** page, you can add through **&lt;script&gt;&lt;/script&gt;** a code that will add &amp; remove a class link to some css.

Here is for the method, but awaiting more elements from you to better guide you.
Regards

Last edit: 6 years 1 month ago by [Philip](/forum/user/34318-philip "View Philip's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS85MDAzNDEtY2hhcmFjdGVyaXN0aWNzLXNlbGVjdGlvbi1yYWRpby1idXR0b24/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.067 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
