Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4

Thread: On page load...

  1. #1
    New Coder
    Join Date
    Dec 2005
    Posts
    18
    Thanks
    0
    Thanked 1 Time in 1 Post

    On page load...

    How can I make a function happen when the page loads? For example I have this button on my page:

    Code:
    <INPUT TYPE="Submit" NAME="SUBMIT" ID="Submit" VALUE="click" class="button">
    How can I make it click or submit automatically when the page is opened? I know its possible, I've done it before, I just forgot how.

    Thanks.

  • #2
    New to the CF scene
    Join Date
    Sep 2006
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    CodeSandbox.net - Programming questions answered.

  • #3
    Senior Coder
    Join Date
    Dec 2004
    Location
    Essex, UK
    Posts
    2,636
    Thanks
    0
    Thanked 0 Times in 0 Posts
    That solution will work fine but you may want to do something like this as it's a bit less obtrusive:

    <script type="text/javascript">
    window.onload=function(){
    document.myform.submit();
    }
    </script>

  • #4
    New Coder
    Join Date
    Dec 2005
    Posts
    18
    Thanks
    0
    Thanked 1 Time in 1 Post
    Thank you very much for the help!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •