title: Changing number field attribute "max" value after success in jQuery
body: <p>I'm still learning jQuery.</p>
  
  <p>I have this form:</p>
  
  <pre><code>&lt;form class="simple-checkout" enctype="multipart/form-data" method="POST" action="&lt;?php echo admin_url('admin-ajax.php'); ?&gt;"&gt;
      &lt;input type="hidden" name="add-to-cart" value="&lt;?php echo htmlspecialchars($getid); ?&gt;"/&gt;
      &lt;input type="number" name="quantity" min="1" max=&lt;?= $available_stock ?&gt; value="1"/&gt;
      &lt;input type="hidden" id="thwepof_product_fields" name="thwepof_product_fields" value="order_date"&gt;
      &lt;input type="hidden" id="order_date" name="order_date" value="&lt;?php echo htmlspecialchars($get_day); ?&gt;"&gt;
      &lt;input type="hidden" name="action" value="create_ajax_checkout"/&gt;
      &lt;input type="submit" value="Add to cart"/&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>I add this to this function:</p>
  
  <pre><code>add_action('wp_ajax_create_ajax_checkout', 'create_ajax_checkout');
  function create_ajax_checkout()
  {
  wp_send_json_success($_POST);
  }
  </code></pre>
  
  <p>And use this js file to handle the Ajax request:</p>
  
  <pre><code>jQuery(document).ready(function ($) {
  $('.simple-checkout').ajaxForm({
      success: function (response) {
          console.log(response);
          //alert("Success");
  
      },
      error: function (response) {
          console.log(response);
          alert("Error!");
          }
      });
  });
  </code></pre>
  
  <p>My question is that the <code>$_POST['quantity']</code> has a <code>max=&lt;?= $available_stock ?&gt;</code>. I would like to reduce that default max value by the quantity of <code>$_POST['quantity']</code>.</p>
  
  <p>So if the default quantity is 30 and you add 2 pieces to your cart then I would like to set the maximum available value to 28.</p>