title: Is there anything I can do instead of $("input:radio").change(function() {} to activate AJAX when a certain radio input is clicked?
body: <p>I have this loop that loops through my database table <code>tvshows</code> to get the names of  the T.V shows and output them to the screen with a radio input:</p>
  
  <pre><code>&lt;div style="width: 200px;"&gt;
  
    &lt;div&gt;
      &lt;?php
  
          $query = "SELECT distinct(title), (id) from tvshows";
          $featured = mysqli_query($conn,$query);
  
              while ($row = mysqli_fetch_assoc($featured)) { ?&gt;
  
                   &lt;div class="list-group-item checkbox" style="  background- 
                   color: #f4f4f4;"&gt;
  
                      &lt;label &gt;&lt;input type="radio" name="re" 
                      class="common_selector collection" style="" value="&lt;?php 
                      echo $row['title']; ?&gt;" id='sale'&gt;   &lt;?php echo 
                      $row['title']; ?&gt;&lt;/label&gt;
                  &lt;/div&gt;
                  &lt;?php
                  }
                  ?&gt;
     &lt;/div&gt;
  &lt;/div&gt; 
  </code></pre>
  
  <p>Here is the AJAX:</p>
  
  <pre><code> $("input:radio").change(function() {
              var product_id = $(this).attr('id');    
              var coll = $(this).attr('value'); 
              var action = "check";
  
        if ($(this).is(":checked")) {
              $.ajax({
                  url:"../PHP_Scripts/fetch_data.php",
                  method: "POST",
                  dataType: "json",
                  data:{
                      coll:coll, action:action, product_id:product_id
                  },
                  success:function(data){
                      $('#product_wrapper').html(data);
                      alert("success");
  
                  }
            });
   });
  </code></pre>
  
  <p>It's the <code>$("input:radio").change(function() {}</code> that is my issue. To summarise why this problem is happening: the script <code>PHP_Scripts/fetch_data.php</code> activates every time the radio input is changed. Its function is to output the products based off of which radio button is clicked. It's an issue because the <code>PHP_Scripts/fetch_data.php</code> also contains some AJAX that adds the product to the cart, so when the radio input changes, and you try to add a product to the cart, the product gets added to the cart the same amount of times as the input has been changed. So if you check a radio input 3 times, then click the button that adds a product to the cart, it will be added 3 times.</p>
  
  <p>The reason I didn't paste every page is that the issue just one line: <code>$("input:radio").change(function() {}</code>. Does anyone know an alternative I can use to activate the AJAX when say, a certain input is checked? </p>