Advertisement
bongzilla

Untitled

Jun 30th, 2022
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. <script>
  2. document.addEventListener("DOMContentLoaded", function(e) {
  3. function modifyForms() {
  4. var forms = document.getElementsByTagName("form");
  5. for (var i = 0; i < forms.length; i++) {
  6. var form = forms[i];
  7.  
  8. var formNameHidden = document.createElement("input");
  9. formNameHidden.setAttribute("type", "hidden");
  10. formNameHidden.setAttribute("name", "formName");
  11. formNameHidden.setAttribute("value", form.getAttribute("name"));
  12. form.appendChild(formNameHidden);
  13.  
  14. var currentURLHidden = document.createElement("input");
  15. currentURLHidden.setAttribute("type", "hidden");
  16. currentURLHidden.setAttribute("name", "currentPage");
  17. currentURLHidden.setAttribute("value", window.location.href);
  18. form.appendChild(currentURLHidden);
  19. }
  20. }
  21.  
  22. modifyForms();
  23. });
  24. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement