title: if any of the input field is not empty or not equal 0 javascript
body: <p>I have stock table. I pull data out from the stack table using sql statemnet, use while loop to display on the webpage. </p>
  
  <p>Please see picture.
  <a href="https://i.stack.imgur.com/42irH.png" rel="nofollow noreferrer">stock page</a> </p>
  
  <p>I have an empty input field next to each line of stock. User should go though the stock and update stock by entering number in the empty field. So the way I want it ti work is user go though stock, enter stock numbers, than there is button at the bottom of page, which user must click to update the stock. </p>
  
  <p>How I can hide the update button of all the fields = 0. if user input any field, the update button should appear, if user change the value, back to 0 it should hide again. </p>
  
  <p>If I give input field an class "stock-val", than use .change function, it works, the problem is if user edit 1 stock item, than another, than another, and go back and mark previous as 0, the button goes hidden. I'm doing it by selecting class and .change will hide it if I mark it 0. </p>
  
  <p>I need a way to show update button if at least 1 field is greater than 0, and hide if all  fields are empty are set to 0. </p>
  
  <p>Thanks. </p>
  
  <p><strong>My Html:</strong> </p>
  
  <pre><code>    &lt;div class="table-responsive"&gt;          
      &lt;table class="table"&gt;
          &lt;tbody&gt;
              &lt;?php
              if(mysqli_num_rows($result_miscellaneous) &gt; 0){
              while($row = mysqli_fetch_array($result_miscellaneous,MYSQLI_ASSOC)){
              ?&gt;
              &lt;tr&gt;
                &lt;td&gt;&lt;?php echo $row['description_stk']?&gt;&lt;/td&gt;
                &lt;td&gt;&lt;input class="form-control" type="text" value="&lt;?php echo $row['clipbundleinfo_stk']?&gt;"&lt;/td&gt;
                &lt;td&gt;&lt;input class="form-control clips-assign-val" type="text" value="0"&lt;/td&gt;
               &lt;/tr&gt;
              &lt;?php
              } 
          }
         ?&gt; 
           &lt;/tbody&gt;
       &lt;/table&gt;
   &lt;/div&gt;
  </code></pre>
  
  <p><strong>Javascript:</strong></p>
  
  <pre><code>    &lt;script&gt;
         $(document).ready(function(){
        $(".clips-assign-val").change(function(){
         var val = $(this).val();
  
          if(val &gt; 0 ){
          $('#clip-bundles-assign-button1').show();
        }else {
       $('#clip-bundles-assign-button2').show();
  
      }
  
     });
    });
    &lt;/script&gt;
  </code></pre>
  
  <p>So How to hide update button, if all the input fields are empty, and only show if at least 1 filed is not empty and more than 0. </p>