Forum Moderators: open

Message Too Old, No Replies

AUTO Submit a form

Want to auto-submit a form onload

         

ahmad_fathy

3:17 am on Jul 12, 2004 (gmt 0)

10+ Year Member



hiii everyone..
I have a Form that consist of a button and a text box

I want to make it submit onload the page ..

Is this possible?

Thanks alot

Bernard Marx

7:34 am on Jul 12, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



window.onload = function(){document.forms["_formName_"].submit()}

ahmad_fathy

1:48 pm on Jul 12, 2004 (gmt 0)

10+ Year Member



here is the code but it give result "The page cannot be displayed" but when I submit the form manually .. it works ok

<html>
<body>
<FORM action="http://sitename.com/cfm/passret.cfm" method="POST" name="Form1">
<B>Login Name:</B> <INPUT type="text" name="LoginName" size="20" value="b"> &nbsp; <INPUT type="submit" name="nekst" value="Next">
</FORM>
<script type="text/javascript">
window.onload = function(){document.forms["Form1"].submit()}
</script>
</body>
</html>

PLZ HELP

ahmad_fathy

12:55 am on Jul 13, 2004 (gmt 0)

10+ Year Member



Up

vkaryl

2:36 am on Jul 13, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



So basically you're shanghai-ing an innocent/unsuspecting user by forcing submit of a form the user may not approve?

ahmad_fathy

6:08 am on Jul 13, 2004 (gmt 0)

10+ Year Member



Hi
I don't need the user to submit cuz it's a server page
.. I will run it to do some order in my script..

Can you help? :(

Bernard Marx

7:46 am on Jul 13, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm stumped. If even using the setTimeout approach suggested by DrDoc here
[webmasterworld.com ] doesn't work for you either, then there may be some security feature in your browser that is stopping auto form submission.

ahmad_fathy

12:24 am on Jul 14, 2004 (gmt 0)

10+ Year Member



Hi ..
Really I think you find the solution .. but what is this option that disable auto submit?
I'm Using IE 6