#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2004
    Posts
    21
    Rep Power
    0

    How to make a submit button automatically click on page load?


    Hello,
    I want to know how to make a form's submit button automatically click when the webpage loads. I figured this would be pretty easy for an experienced programmer who knows all the javascript functions etc, unfortunately I'm not an experienced programmer...

    Thanks in advance for any suggestions!

    Scott
    Last edited by sqwuade; April 9th, 2004 at 08:11 AM.
  2. #2
  3. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2004
    Posts
    293
    Rep Power
    0
    Can u supply the form u are trying to make this event happen with. You may simply need an ON_LOAD function within your code. Although more information about your requirements is required.

    jackson17
  4. #3
  5. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2003
    Posts
    187
    Rep Power
    12
    Why would u need this? you wouldnt collect very much information if u didnt give users time to enter it.
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2004
    Posts
    21
    Rep Power
    0
    I want to make this submit button click automatically when the page is loaded so the .mp3 file plays that says "Please make a selection" (This happens now if you click the submit button with out selecting anything from the dropdown menu):

    http://operationspacemission.com/music/index.php

    The first option in the form is automatically selected already by using the "selected" function in the option tag like this:

    <option value="MakeaSelection" selected>

    Thanks, Scott
    Last edited by sqwuade; April 9th, 2004 at 09:19 AM.
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2004
    Posts
    12
    Rep Power
    0
    onLoad="javascript:document.FORMNAME.submit()"

    replace formname with the... name of your form
  10. #6
  11. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2004
    Posts
    21
    Rep Power
    0
    OK, thanks for the advice qwertq! I'll give that a shot when I can and let you know how it works.

    Scott
  12. #7
  13. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2004
    Posts
    21
    Rep Power
    0
    I tried adding the following code in the <head> section and then also in the <body> section but it didn't work (name of the form is "songs")... Any idea what I'm doing wrong?

    <script type="text/javascript"> onLoad="javascript:document.songs.submit()"
    </script>

    Thanks, Scott
  14. #8
  15. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2013
    Posts
    1
    Rep Power
    0
    Originally Posted by sqwuade
    I tried adding the following code in the <head> section and then also in the <body> section but it didn't work (name of the form is "songs")... Any idea what I'm doing wrong?

    <script type="text/javascript"> onLoad="javascript:document.songs.submit()"
    </script>

    Thanks, Scott
    Hi sqwuade,

    I am facing the same kind of issue, I'll be tryin to write the code this week, if I manage to make it work i'll write you a post in this thead explaining how I did it, otherwise you'll have to find the solution on your own
    Cheers and hf coding!
  16. #9
  17. Known to taste like chicken
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2003
    Location
    In front of my computer
    Posts
    399
    Rep Power
    312
    Originally Posted by SwFlipNico
    Hi sqwuade,

    I am facing the same kind of issue, I'll be tryin to write the code this week, if I manage to make it work i'll write you a post in this thead explaining how I did it, otherwise you'll have to find the solution on your own
    Cheers and hf coding!
    Somehow I suspect that he no longer has this issue...
    "Take thy beak from out my heart, and take thy form from off my door" - Homer J Simpson / Edgar Allan Poe

    Looking for a project Idea?
  18. #10
  19. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2013
    Posts
    5
    Rep Power
    0

    web design


    its try:
    <form action="(URL?)/yyy.php" method="post" id="h1">
    <input type="hidden" name="LoginEmail" value="user [at] domain.com">
    <input type="hidden" name="LoginPassword" value="mycleartextpassword">
    <input type="submit" name="Authenticate" value="Login">
    <input type="hidden" name="Action" value="1" >
    </form>

IMN logo majestic logo threadwatch logo seochat tools logo