is there a way via java script to force a form to be posted back to the server...
document.FormData.submit
thanks
kurt
Printable View
is there a way via java script to force a form to be posted back to the server...
document.FormData.submit
thanks
kurt
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:
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?Code:<body onunload="javascript:somefunction()">
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
Yeah, that's what I was recommending to him as well, except it's document.form1.submit1.click
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.
Here's a WORKING example:Quote:
A lazy programmer is a good programmer.
Usually you wouldn't make all the <input> tags hidden tho. :)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>
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 :).
Thanks a ton