Shopify themes, liquid, logos, and UX
Hi all, I am very new to shopify and want to create a form with a drop down box whose items are dependent on another drop down box. Luckily, a solution to this problem has been posted online here:
Theres a few different solutions listed..I tried the first solution by adding the code to page.contact.liquid but I couldnt get it to work.
Below is the top solution posted on that link. I added the html code as is to my page.contact.liquid file, but I didnt know where to put the JS code.
Can someone please help make the code work for a "contact us" form on a shopify store? In case it matters, I am using the narrative theme.
Id appreciate all help! Thank you!!
HTML
<!-- Source: --> <select id="source" name="source"> <option>MANUAL</option> <option>ONLINE</option> </select> <!-- Status: --> <select id="status" name="status"> <option>OPEN</option> <option>DELIVERED</option> </select>
JS
$(document).on('ready', function () { $("#source").on('change', function () { var el = $(this); if (el.val() === "ONLINE") { $("#status").append("<option>SHIPPED</option>"); } else if (el.val() === "MANUAL") { $("#status option:last-child").remove(); } }); });
User | RANK |
---|---|
70 | |
65 | |
64 | |
53 | |
49 |
We're excited to announce improvements to the threaded messaging experience in our communi...
By TyW May 31, 2023Thank you to everyone who participated in our AMA with Klaviyo. It was great to see so man...
By Jacqui May 30, 2023Photo by Marco Verch Sales channels on Shopify are various platforms where you can sell...
By Ollie May 25, 2023