Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script>
- document.addEventListener("DOMContentLoaded", function(e) {
- function modifyForms() {
- var forms = document.getElementsByTagName("form");
- for (var i = 0; i < forms.length; i++) {
- var form = forms[i];
- var formNameHidden = document.createElement("input");
- formNameHidden.setAttribute("type", "hidden");
- formNameHidden.setAttribute("name", "formName");
- formNameHidden.setAttribute("value", form.getAttribute("name"));
- form.appendChild(formNameHidden);
- var currentURLHidden = document.createElement("input");
- currentURLHidden.setAttribute("type", "hidden");
- currentURLHidden.setAttribute("name", "currentPage");
- currentURLHidden.setAttribute("value", window.location.href);
- form.appendChild(currentURLHidden);
- }
- }
- modifyForms();
- });
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement