SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Enthusiast
    Join Date
    Feb 2002
    Location
    Brampton, Ontario
    Posts
    88
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Auto submit a form

    is there a javascript, or something i put into the <form ...> tag that will automatically submit the form???

    it's a form with just hidden fields that i want to be submitted automatically when the page loads, without anyone clicking anybuttons

    thanks.

  2. #2
    SitePoint Enthusiast Jack Michaelson's Avatar
    Join Date
    May 2002
    Location
    Netherlands
    Posts
    30
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    How about:
    Code:
    ...
    <body onload="form1.submit();">
    
    <form name="form1">
    ...
    </form>
    </body>
    Does this answer your question?
    Jack

  3. #3
    SitePoint Enthusiast
    Join Date
    Feb 2002
    Location
    Brampton, Ontario
    Posts
    88
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    yes thak you

  4. #4
    Currently Occupied; Till Sunda Andrew-J2000's Avatar
    Join Date
    Aug 2001
    Location
    London
    Posts
    2,475
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    just to let you know

    PHP Code:

    <script type="text/javascript">

    function 
    Refresh() 
    {

        
    document.form1.action  document.form1.url.value
        
    document.form1.method  document.form1.how.value
        
    document.form1.encType document.form1.enc.value;
        
    document.form1.submit(); 




    </script>

    <body>

    <form name="form1">
      <input type="text"   id="url" value="http://www.google.com" />
      <input type="text"   id="how" value="get"                   />
      <input type="text"   id="enc" value="text/html"             />
      <input type="button" id="sub" onclick="Refresh()"           />
    </form>

    </body> 

  5. #5
    SitePoint Member
    Join Date
    Apr 2004
    Location
    holland
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    whaaaaaaaaa i searched for this **** everywhere! and this is the only one thats actually working


Bookmarks

Posting Permissions

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