Hide & display a custom text field base on variation selection.

Hide & display a custom text field base on variation selection.

Miraza606-Ozbix
Shopify Partner
2 0 0

Hello, everyone I have size variations on a product page like S, M, L & "Custom".

I want to display a custom text box for custom sizing. Customers can write custom size detail when clicking on "Custom" size variation & hide it when clicking on S, M, L, size, etc. 
This is my text field code 

 

 

<div class="product-form__input">
<label class="form__label" for="custom-size">Custom Size</label>
<input class="field__input" required type="text" id="custom-size" form="{{product_form_id}}" name="properties[Your Size]" />
</div>

 

 

 

I want show this code after size variant picker block. 

 

Reply 1 (1)

Guleria
Shopify Partner
4063 798 1147

Hello @Miraza606-Ozbix ,

 

Find the callback function or write a new one which will work on click of variant option size only.
You have to just make it conditional (show/hide) so it will work on variant option size and 

 

Thanks

- Custom themes, UI/UX design, ongoing maintenance & support.
- Drop an email   if you are looking for quick fix or any customization
- Email: guleriathakur43@gmail.com Skype: live:navrocks1
- Try GEMPAGES a great page builder