Forums

This topic is locked

Javascript onload submission

Posted 11 Jan 2006 03:46:47
1
has voted
11 Jan 2006 03:46:47 Moshe Cohen posted:
Im looking to create the following form but it should submit the form (one hidden value) on loading the page automatically...wihtout hitting the submit...

Can anyone help?


<form name="vote" action="www.sonypictures.com/movies/silenthill/postercontest/vote/vote_submit.php" method="post"><input type="hidden" name="imgId" value="1136">
<a href="javascript:document.vote.submit();">Submit</a>
</form>

Replies

Replied 11 Jan 2006 11:31:40
11 Jan 2006 11:31:40 Lee Diggins replied:
Hi Moshe

Create a script tag and place it <b>after</b> the form and put the javscript submit code in, like this:

&lt;script language="JavaScript"&gt;
document.vote.submit();
&lt;/script&gt;

Sharing Knowledge Saves Valuable Time!!!
~ ~ ~ ~ ~ ~
<b>Lee Diggins</b> - <i>DMXzone Manager</i>
<font size="1">[ Studio MX/MX2004 | ASP -> VBScript/PerlScript/JavaScript | SQL | CSS ]</font>
Replied 11 Jan 2006 17:08:56
11 Jan 2006 17:08:56 Moshe Cohen replied:
Tried it. but it brings up a blank page (unless your browser session has successfully gone there before then it works) but if I close my broswer and try it it displays blank.

see 2 pages....
this is the voting submission page i want to automate.
www.sonypictures.com/movies/silenthill/postercontest/vote/vote_popup.php?imgId=1136

I want to automate it on this page...
www.tzachlist.com/testsonyposter.html

Replied 12 Jan 2006 11:21:43
12 Jan 2006 11:21:43 Lee Diggins replied:
Hi Moshe

The form is definately being submitted, I've tested it here, so there's either a problem with the vote_submit page or the form on your automatic page.

Sharing Knowledge Saves Valuable Time!!!
~ ~ ~ ~ ~ ~
<b>Lee Diggins</b> - <i>DMXzone Manager</i>
<font size="1">[ Studio MX/MX2004 | ASP -> VBScript/PerlScript/JavaScript | SQL | CSS ]</font>

Reply to this topic