How to submit a form when page loads using javascript?

I know this question has been answered many times but in my case the JavaScript code creates a infinite loop which makes my page load continuously,

    window.onload = function(){

I also tried the below one and it doesn’t work.

<body onload="document.theform.submit()";>

The below code does what I need but it’s not perfect.

    window.onload = function(){


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s