Click here to Skip to main content
15,938,446 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I want to automatically click submit on this form when the page loads

HTML
<form role="form" accept-charset="UTF-8" method="post" action="https://FORMURL.com" novalidate="novalidate"> <div> </div> <div class="row k"> <input type="submit" value="I submitted my ID Docs" class="button button-style w"> </div> <span style="display: none;"></span> </form>


What I have tried:

I tried using this code but it requires a form ID and I do not have access to the form to include an ID.

JavaScript
<script type="text/javascript">
        window.onload = function () {
        document.Submit.click();
        }
    </script>
Posted
Updated 14-Jun-18 23:42pm
v2

1 solution

If it's the only form on the page

document.getElementsByTagName("form")[0].submit();
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900