Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4552388
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T16:46:53+00:00 2026-05-21T16:46:53+00:00

I have this code to submit a form automatically on page load, but it

  • 0

I have this code to submit a form automatically on page load, but it takes like 20 seconds in order to do the submit after the page is completely loaded.

Am I doing anything wrong here?
If not, how to bypass that 20 seconds delay?
Can we make the body onload event faster?

The code:

<html>
<body onload="document.forms['loginform'].submit();">
<form id="loginform" name="loginform" action="https://login.url.com" method="post" style="visibility:hidden">
    <input type="hidden" value="" name="hhh">
    <input type="text" value="username" id="login_field" name="username">
    <input type="password" value="pass" id="password_field" name="password">
                <input type="hidden" value="" id="password_strength" name="password_strength">
                <input type="hidden" value="/index.php" id="sendto" name="sendto">
    <button id="btn_logon" type="submit"><span>Login</span></button>
        </form>
</body>
</html>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T16:46:54+00:00Added an answer on May 21, 2026 at 4:46 pm

    The load event is fired after all dependencies of the page – images, externa resources, etc. have been loaded. The event you should watch for is the one that gets fired when the DOM is ready – DOMContentLoaded which has been standardized in HTML5.

    For a cross-browser solution, pick an implementation from any of the existing JavaScript libraries like MooTools, jQuery, Dojo, etc.

    This link contains one implementation. If your DOM content is too big, and downloading and parsing just that is taking time, then consider adding your script right after the <form> itself.

    <form id="loginform" name="loginform" action=".." method="post">
    ...
    </form>
    <script>
        // submits the form right after it is parsed
        document.forms['loginform'].submit();
    </script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this code. The code below is working in Firefox, but it is
I have a form, and I want automatically to update it when I click
I want to have a feature to submit several forms on a page when
I have a webrequest that returns a html response which has form inside with
What is the easiest and most graceful way to auto-submit an AJAX form when
I am writing a watir script to test an upload form. But the script
I have inherited an ASP.net codebase and I have very limited ASP.net skills. I
Basically, I have a process that is broken out into 4 forms (thus, 4
i m using tinymce editor on joomla component that behave strangly tinymce is already
I'm using CKEditor on a textarea and the jQuery validation plugin ( http://bassistance.de/jquery-plugins/jquery-plugin-validation/ )

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.