title: Using jQuery to change a dropdown menu when a checkbox is checked
body: <p>i'm a bit confused about how to go about this problem.  Currently when a user changes the "quantity" from the dropdown, it checks the checkmark, but when its moved to zero the checkmark is unchecked.  </p>
  
  <pre><code>var val = 0
    $('.drop').on('change',function() {
      var val = $(this).val();
      if(val &gt; 0) {
        var product = $(this).attr("prodindex");
        $('#switchName' + product).prop('checked', true);
      }
      else {
        var product = $(this).attr("prodindex");
        $('#switchName' + product).prop('checked', false);
      }
    });
  </code></pre>
  
  <p>part of the form:</p>
  
  <pre><code>&lt;input class='check' id='switchName0' type='checkbox'&gt;
                        &lt;label for='switchName0'&gt;&lt;/label&gt;
                      &lt;/div&gt;
                      &lt;div class='col-lg-8'&gt;
                        &lt;input id="order_products__product_id" name="order_products[][product_id]" type="hidden" value="4" /&gt;
                        test
                        &lt;br&gt;
                        &lt;div class='subheader'&gt;$22.00&lt;/div&gt;
                      &lt;/div&gt;
                      &lt;div class='col-lg-2'&gt;
                        &lt;select class="drop" data-cost-per-unit="2200" id="test" name="order_products[][quanity]" prodindex="0"&gt;&lt;option value="0"&gt;0&lt;/option&gt;
                        &lt;option value="1"&gt;1&lt;/option&gt;
                        &lt;option value="2"&gt;2&lt;/option&gt;
                        &lt;option value="3"&gt;3&lt;/option&gt;
                        &lt;option value="4"&gt;4&lt;/option&gt;
                        &lt;option value="5"&gt;5&lt;/option&gt;
                        &lt;option value="7"&gt;7&lt;/option&gt;
                        &lt;option value="8"&gt;8&lt;/option&gt;
                        &lt;option value="9"&gt;9&lt;/option&gt;
                        &lt;option value="10"&gt;10&lt;/option&gt;
                        &lt;option value="11"&gt;11&lt;/option&gt;
                        &lt;option value="12"&gt;12&lt;/option&gt;
                        &lt;option value="13"&gt;13&lt;/option&gt;
                        &lt;option value="14"&gt;14&lt;/option&gt;
                        &lt;option value="15"&gt;15&lt;/option&gt;&lt;/select&gt;
                      &lt;/div&gt;
                    &lt;/div&gt;
                  &lt;/div&gt;
                &lt;/div&gt;
              &lt;/div&gt;
  </code></pre>
  
  <p>I want to make it so if the checkmark is not checked and you check it, it changes the quantity to 1 and if you uncheck it, it goes to zero.  But since I have this other jquery here, if i use <code>$('.checkbox').on('change',fucntion(){}</code> it will change every time the dropdown is moved.  Whats a better solution to this problem?</p>