From 1574b2dc3764c41100e9743b31206cd04971bb09 2014-12-04 02:09:25 From: Bradley M. Kuhn Date: 2014-12-04 02:09:25 Subject: [PATCH] Match right form for these changes. The general selectors previously used here matched either form. With this change, they will only match the form for which the selection was actually made. --- diff --git a/www/conservancy/static/supporter-page.js b/www/conservancy/static/supporter-page.js index f424b0384ad0a827a8cd70b4c18a395d549bb8f9..ca9e4bb08a7afff163b0a8a9a73863df58756ba7 100644 --- a/www/conservancy/static/supporter-page.js +++ b/www/conservancy/static/supporter-page.js @@ -35,13 +35,15 @@ $(document).ready(function() { $(".t-shirt-size-selector").hide(); $('input[name=os1]:radio').change(function() { var input=$(this); + var tShirtSelector = input.parent().children('.t-shirt-size-selector') + var noShippingSelector = input.parent().children('input#no_shipping'); var value = input.val(); if (value == "Yes") { - $(".t-shirt-size-selector").show(); - $("#no_shipping").val("2"); + tShirtSelector.show(); + noShippingSelector.val("2"); } else { - $(".t-shirt-size-selector").hide(); - $("#no_shipping").val("0"); + tShirtSelector.hide(); + noShippingSelector.val("0"); } }); $('*#amount').addClass("valid");