JSFiddle - React, Tailwind, and code Playground

by Matt Hopkins

HTML

<form name="form1" id="form1" method="post" action="https://dualpolymersystem.com/store/detail.php">
  <input type="text" name="products[113][qty]" style="width:50px" value="1">
  <input type="hidden" name="products[113][op_id]" value="113">
  <input type="submit" value="Add To Cart"/>
</form>
<button onclick="formData">Add To Cart</button>

JavaScript

function formData() {
  var theForm = document.getElementById('form1');
  console.log(new FormData(theForm));
}