title: JavaScript is not working properly for show / hide function
body: <p>In the bootstrap modal form, I want to show some fields based on the option selected in the select field, its working as expected for the first row, but it's not from the 2nd rows.</p>
  <p>Client List Table</p>
  <pre><code>S.No    Client_Name          Update_Status
  1        Client1               Update       
  2        Client2               Update       
  3        Client3               Update       
  4        Client4               Update
  
      
  </code></pre>
  <p>By clicking the update button, it will open a bootstrap modal</p>
  <p>Update button code</p>
  <pre><code>&lt;a class=&quot;btn btn-sm btn-info&quot; href=&quot;&quot; data-toggle=&quot;modal&quot; data-target=&quot;#leadModal&lt;?php echo $row1['leads_id'] ?&gt;&quot;&gt;Update&lt;/a&gt;
  </code></pre>
  <p>Modal Code</p>
  <pre><code>&lt;div class=&quot;modal fade&quot; id=&quot;leadModal&lt;?php echo $row1['leads_id'] ?&gt;&quot; tabindex=&quot;-1&quot; role=&quot;dialog&quot; aria-labelledby=&quot;exampleModalLabel&quot; aria-hidden=&quot;true&quot;&gt;
    &lt;div class=&quot;modal-dialog&quot; role=&quot;document&quot;&gt;
      &lt;div class=&quot;modal-content&quot;&gt;
        &lt;div class=&quot;modal-header&quot;&gt;
          &lt;h5 class=&quot;modal-title&quot; id=&quot;exampleModalLabel&quot;&gt;Comments&lt;/h5&gt;
          &lt;button type=&quot;button&quot; class=&quot;close&quot; data-dismiss=&quot;modal&quot; aria-label=&quot;Close&quot;&gt;
           &lt;span aria-hidden=&quot;true&quot;&gt;&amp;times;&lt;/span&gt;
          &lt;/button&gt;
        &lt;/div&gt;
       &lt;div class=&quot;modal-body&quot;&gt;
         &lt;form action=&quot;&quot; method=&quot;POST&quot;&gt;
          &lt;select name=&quot;status&quot; id=&quot;select&quot; required&gt;
            &lt;option selected=&quot;true&quot; disabled=&quot;disabled&quot; value=&quot;&quot;&gt;Choose Status&lt;/option&gt;
            &lt;option value=&quot;NA&quot;&gt;No Answer&lt;/option&gt;
            &lt;option value=&quot;Demo&quot;&gt;Appointment&lt;/option&gt;
            &lt;option value=&quot;IP&quot;&gt;In Progress&lt;/option&gt;
            &lt;option value=&quot;NI&quot;&gt;Not Interested&lt;/option&gt;
            &lt;option value=&quot;complete&quot;&gt;Lead Complete&lt;/option&gt;
          &lt;/select&gt;
          &lt;div class=&quot;select3&quot; id=&quot;select3&quot;&gt;
            &lt;select class=&quot;mt-2&quot; name=&quot;trainer&quot; required&gt;
            &lt;option selected=&quot;true&quot; disabled=&quot;disabled&quot; value=&quot;&quot;&gt;Select the Trainer&lt;/option&gt;
            &lt;option value=&quot;Trainer 1&quot;&gt;Trainer 1&lt;/option&gt;
            &lt;option value=&quot;Trainer 2&quot;&gt;Trainer 2&lt;/option&gt;                     
            &lt;/select&gt;
           &lt;/div&gt;
           &lt;div class=&quot;select2&quot; id=&quot;select2&quot;&gt;
            &lt;select class=&quot;mt-2&quot; name=&quot;trainer&quot; required&gt;
            &lt;option selected=&quot;true&quot; disabled=&quot;disabled&quot; value=&quot;&quot;&gt;Select the Package&lt;/option&gt;
            &lt;option value=&quot;Trainer 1&quot;&gt;Package 1&lt;/option&gt;
            &lt;option value=&quot;Trainer 2&quot;&gt;Package 2&lt;/option&gt;                     
            &lt;/select&gt;
           &lt;/div&gt;
         &lt;/form&gt;
                          
       &lt;/div&gt;
     &lt;/div&gt;
   &lt;/div&gt;
  </code></pre>
     
  <p>Java Script Code</p>
  <pre><code>&lt;script&gt;
      $(&quot;#status&quot;).change(function(){
      if($(this).val() == 'complete'){
        $(&quot;#select2&quot;).show();
        $(&quot;#select3&quot;).hide();
      }else if($(this).val() == 'Demo'){
        $(&quot;#select3&quot;).show();
        $(&quot;#select2&quot;).hide();
      }else{
        $(&quot;#select2&quot;).hide();
        $(&quot;#select3&quot;).hide();
      }
  
  });
  &lt;/script&gt;
  </code></pre>
  <p>It's working fine, for the first update button (Client 1 row) but the javascript function is not working for the rest of the rows.</p>