How do I hide a contact form field until another field is filled?

chert
Shopify Partner
2 0 0

Hello,

 

I would like a simple script in global.js which follows the logic below but I need your help in writing the script.

 

If "Name" field =  blank

Hide "Comment" field

Else

Show "Comment" field

 

Can someone please help me? I provided a screen shot of the form and its HTML.

I understand there are multiple form apps that have conditional logic but I want this to be a learning experience for me. Thank you.

 

The shopify store is https://permaink.myshopify.com/pages/contact with the store PW = "help".

 

chert_0-1648778071276.png

 

Replies 0 (0)