• Howdy! Welcome to our community of more than 130.000 members devoted to web hosting. This is a great place to get special offers from web hosts and post your own requests or ads. To start posting sign up here. Cheers! /Peo, FreeWebSpace.net
managed wordpress hosting

Submit form without click

I don't understand. Wouldn't the form be blank if submitted as soon as the page loads...? The only thing I can think of is making the content of like input areas submit when you de-select them (e.g. press tab or click elsewhere)
 
I can't imagine why it'd be useful ...

PHP:
window.onload=function()
{
     myForm.submit();
}
 
I can't imagine why it'd be useful ...

PHP:
window.onload=function()
{
     myForm.submit();
}

That's how you make a form be submitted as soon as the page loads.

I'd say, add it to the bottom of the page in your <script> tags, so it is the last thing to be executed, just to avoid any forms of data loss due to slow connections.
 
with javascript is very simple

same method can be applied on body tag, like this
Code:
<body onload="myForm.submit();">
 
Back
Top