Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Submit form without a function and not onload in body

Status
Not open for further replies.

ralphiooo

Programmer
Oct 23, 2005
64
GB
Hi, I was wondering how to submit a form called frmPost in the body part of the code and not in a function so it auto submits when you go to the page. I know it sounds a pretty stupid scenario but I really need to do it this way. Appreciate the help. Thanks
 
Hi, i don't want it in the body tag, I want it within. I tried something like:

<script type="text/javascript" language="javascript">
document.forms['fmrPost'].submit();
</script>

but it did not work. Cheers anywayz.
 
Sorry - you simply said not in a function, so I assumed that would be fine.

What you've shown will only work after the form is loaded. Maybe put it right at the end of the page, right before the closing body tag?

Of course - you also need to ensure you have no form elements named "submit" - they would stop the submission working.

Dan



[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Ah cheers, was the form element named submit that had me.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top