Custom input field to show when certain option value is selected

Custom input field to show when certain option value is selected

samuelbreezey
Visitor
2 0 0

Hi all,

I was wondering if you can help and point me in the right direction.

I have some items that require personalisation. I have created a text input box for personalisation, however, I only want this to show up when a product item that has personalisation as "Yes" in its variation.

See image below:

Capture.PNG

 

The code I currently have in product-template-custom.liquid is:

<div class="product-single__quantity">
<label for="enter-personalisation">Enter Personalisation</label>
<input id="enter-personalisation" type="text" name="properties[Enter Personalisation]">
</div>

 

Option name: Personalisation
Option values: Yes, No

I hope that you can help

Replies 2 (2)

JHKCreate
Shopify Partner
3571 638 927

Hi @samuelbreezey 

You would need JS to get this done, it won't work through Liquid if user cycles back between Yes & No. What theme are you using?

Did we solve your issue? Like & Mark As Solution to help the community
Should you need any direct help: contact@jhkcreate.com

Learn more about us: jhkcreate.com
samuelbreezey
Visitor
2 0 0

Thank you, I am using Brookyln

 

Here is the website: https://bridesandbabes.myshopify.com

haohao