Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Execute Form post on page load

Posted on 2009-05-13
3
Medium Priority
?
199 Views
Last Modified: 2012-05-06
Hi All,

I am trying to submit a web form on page load but I can't get it to behave.

I have conditional PHP statement and if the condition is met then it loads this form with pre-filled field values.

I would like to at this point submit the form automatically. I have tried using the following javascript but it doesn't seem to be working.. does anyone have any ideas?

Thanks,

Rit
<script type="text/javascript"> 
    Window.onload = submitit;
	
	Function submitit() {
	document.getElemenById("co-shipping-method-form").submit();
	}
</script>

Open in new window

0
Comment
Question by:rito1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 7

Accepted Solution

by:
Jonah11 earned 1000 total points
ID: 24372824
uncapitalize "Window" and "Function" and it should work.
0
 
LVL 14

Assisted Solution

by:sam2912
sam2912 earned 1000 total points
ID: 24372830

<script type="text/javascript"> 
window.onload = submitit;
        
function submitit() {
   document.getElementById("co-shipping-method-form").submit();
}
</script>

Open in new window

0
 
LVL 1

Author Closing Comment

by:rito1
ID: 31580883
Excellent, thanks.
0

Featured Post

The top UI technologies you need to be aware of

An important part of the job as a front-end developer is to stay up to date and in contact with new tools, trends and workflows. That’s why you cannot miss this upcoming webinar to explore the latest trends in UI technologies!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses how to create an extensible mechanism for linked drop downs.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question