title: Passing variable to form action javascript and HTML
body: <p>I have a form to update an entity called Equipment. This form must pass in the action the route '/' serial number of the equipment.</p>
  
  <p>How can i pass the serial number of this entity? </p>
  
  <p>This form is in a modal. See below: </p>
  
  <pre><code>&lt;form
   name="editEquipmentForm"
   id="editEquipmentForm"
   class="form-horizontal"
   method="POST"
   action="/equipments/SERIALNUMBER"  &lt;-- I need pass the serial here
  &gt;
  </code></pre>
  
  <p>I get the variable in another file called request.ejs. This file is included by the index.ejs, that has the modal.</p>
  
  <p>Here's how i get the serialnumber:</p>
  
  <pre><code>function getEquipmentData(serialNumber) {
  var serialNumber = serialNumber;
  setEditInputs();
  document.getElementById("serialnumber2").value = serialNumber;
  
  $.ajax({
    url: "equipments/" + serialNumber,
    type: "get",
    success: function(response) {
      document.getElementById("sha1Curve2").value = response[0].sha1Curve;
      document.getElementById("equipmentName2").value =
        response[0].equipmentName;
      document.getElementById("position2").value = response[0].position;
      document.getElementById("idealRangeMin2").value =
        response[0].idealRangeMin;
      document.getElementById("idealRangeMax2").value =
        response[0].idealRangeMax;
    },
    error: function(xhr) {
      console.log(xhr);
    }
  });}
  </code></pre>
  
  <p>This function is called when i open the modal.</p>
  
  <p>Thanks for any tips.</p>