Show text box input when a option is selected

Hello, I’m totally clueless with liquid and only have some basic knowledge of HTML and CSS, so I’m sorry if this is a basic question.

I have created a custom product template and added a “Custom Liquid” block with code for a dropdown menu, so people can choose a card with their order. From the multiple options I would like to show a text box input only when the “Custom” value is selected.

This is the code I’m using for the dropdown:


and this is the text box I wish to show when “Custom” is selected


I tried adding an IF statement after the dropdown div, but I have no knowledge on how to currectly call my “Custom” option, nor if it is enough or I should add some kind of script.


 

{% if option == 'Custom' %}

{% endif %}

I also tried this solution: https://community.shopify.com/post/1014483 but could not make it work.

Anyone can guide me through this? Thanks!

@Oupas , can you please share the url.

Hello @Ajay-app-dev , here it is: https://shop.oupasdesign.com/products/viana

Hi @Oupas , I got it. You need to work with javascript to show the field. Have you added any javascript code?