Sha256: 45a805718c43b9797126a487660cdae8b913652c5a85209370966cff7252f9da

Contents?: true

Size: 1.27 KB

Versions: 1

Compression:

Stored size: 1.27 KB

Contents

<table class="uikit-table">
  <thead>
    <tr>
      <th>Date</th>
      <th>Item number</th>
      <th>Amount</th>
    </tr>
  </thead>

  <tbody>
    {% for i in (1..3) %}
    <tr class="item-row">
      <td data-label="Date">
        {% include forms/date-field.html
          required="true"
          past_date="true"
        %}
      </td>

      <td data-label="Item number">
        {% include forms/text-field.html
          pattern="[0-9]*"
          required="true"
        %}
      </td>

      <td data-label="Amount">
        {% include forms/text-field.html placeholder="$"
          pattern="[0-9]*"
          type="number"
          step="0.01"
          required="true"
        %}
      </td>
    </tr>
    {% endfor %}
  </tbody>
</table>

{% include buttons/link-button.html text="Add another item" className="uikit-btn--tertiary uikit-btn--block" onclick="addRow()"%}

<script type="text/javascript">
  var addRow = function() {
    var xhr = new XMLHttpRequest();
    xhr.responseType = 'document';

    xhr.open('GET', window.location.href);
    xhr.onload = function() {
      var tableRow = this.response.querySelector('.item-row');
      var tableBody  = document.querySelector('.uikit-table tbody');

      tableBody.appendChild(tableRow);
    };

    xhr.send();
  }
</script>

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
dta_rapid-0.7.6 _includes/forms/item-table.html