Results 1 to 7 of 7

Thread: Sumbit a Form

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2000
    Location
    Manchester NH
    Posts
    833
    is there a way via java script to force a form to be posted back to the server...


    document.FormData.submit


    thanks
    kurt
    Kurt Simons
    [I know I'm a hack but my clients don't!]

  2. #2
    Guest
    The webpage must have an "onunload" event (or something similar) that fires when the window is closed or another page is loaded. Can't you use that?

    I assume it would be something like:

    Code:
    <body onunload="javascript:somefunction()">
    The only reason I know this event must exist is because alot of Warez sites doit. You know...when you close one crap popup window another 5 appear?

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2000
    Location
    Manchester NH
    Posts
    833
    thats now what I am trying to do...

    lets say we have a form on a page that is waiting for a user to click submit. Well lets say his mouse moves over a picture (that is not part of the form) I want the submit button to automatically get clicked
    Kurt Simons
    [I know I'm a hack but my clients don't!]

  4. #4
    Addicted Member Mage33's Avatar
    Join Date
    Aug 2000
    Location
    Petaluma, California
    Posts
    138
    Yeah, that's what I was recommending to him as well, except it's document.form1.submit1.click
    Stephen Haney- 115 116 101 118 101 31 72 65 78 69 89
    -ShardsOfSilence.net- ^ My name in ASCII ^
    You forget something new every day
    | WinME | VB6 Pro | MSC++ | Lambda MOO |

  5. #5
    Guest
    Stop bitchin about wether it's formname.submit or formname.submitbutton.click...

    I've had both of them working although I feel that you may as well use the one that requires the least coding.

    A lazy programmer is a good programmer.
    Here's a WORKING example:
    Code:
    <html>
      <head>
        <title>MRHP: Open Diary Loader</title>
      </head>
      <body onload="javascript:loginform.submit()" bgcolor="#FFFFFF" text="#000000" link="#800080" vlink="#008000" alink="#FFFF00">
        <form name="loginform" action="http://www.opendiary.com/express.asp" method="post">
          <input type="hidden" name="logstring" value="... dreams ...">
          <input type="hidden" name="logpw" value="*******">
          <input type="hidden" name="localpage" value="/entrylist.asp?authorcode=A182232">
        </form>
        <font face="Arial, Helvetica, sans-serif">
          Open Diary is loading...please wait.
        </font>
      </body>
    </html>
    Usually you wouldn't make all the <input> tags hidden tho.

  6. #6
    Addicted Member Mage33's Avatar
    Join Date
    Aug 2000
    Location
    Petaluma, California
    Posts
    138

    Cool

    Heh, good point, I just didn't know if the way he had come up with worked and I'm at work so I didn't really want to spend the time to test it .
    Stephen Haney- 115 116 101 118 101 31 72 65 78 69 89
    -ShardsOfSilence.net- ^ My name in ASCII ^
    You forget something new every day
    | WinME | VB6 Pro | MSC++ | Lambda MOO |

  7. #7

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2000
    Location
    Manchester NH
    Posts
    833
    Thanks a ton
    Kurt Simons
    [I know I'm a hack but my clients don't!]

Posting Permissions

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



Click Here to Expand Forum to Full Width