templates/company/_form.html.twig line 1

Open in your IDE?
  1. {{ form_start(form, {'attr': {'id': 'myForm'}}) }}
  2.     {{ form_widget(form) }}
  3.     <button type="submit" class="btn btn-primary" id="submitBtn">
  4.         {{ button_label|default('Save') }}
  5.     </button>
  6. {{ form_end(form) }}
  7. <script>
  8. document.getElementById("myForm").addEventListener("submit", function() {
  9.     const btn = document.getElementById("submitBtn");
  10.     btn.disabled = true;
  11.     btn.innerText = "Wait...";
  12. });
  13. </script>
  14. <style>
  15. .btn:disabled {
  16.     opacity: 0.6;
  17.     cursor: not-allowed;
  18. }
  19. </style>