window.onload not being called

R

Richard Jonas

I'm trying to submit a form from a window.onload event as follows:

<body>
<form method="POST" action="http://www.website.co.uk" name=login>
<INPUT TYPE=hidden NAME="Username" value=username04761316 >
<INPUT TYPE=hidden NAME="Password" value=password05497967 >
<INPUT TYPE=hidden value="Sign in">
</FORM>
</body>
<script>
window.onload = document.forms[0].submit;
</script>

This page looks up a username and password and submits a form to log
on to another application on a different server. This works on my PC
and on most other PCs I've used to test this on, but it's not working
on one of our user's PCs. It remains on this page, and it appears as
if no attempt is made to execute the script.

We're both using Internet Explorer 6. Are there any browser settings
(or anything else she might have installed, such as popup blockers)
that might stop this code being run? I've checked the proxy server
isn't stripping out the JavaScript.

Thanks,

Richard
 
M

Martin Honnen

Richard said:
I'm trying to submit a form from a window.onload event as follows:

<body>
<form method="POST" action="http://www.website.co.uk" name=login>
<INPUT TYPE=hidden NAME="Username" value=username04761316 >
<INPUT TYPE=hidden NAME="Password" value=password05497967 >
<INPUT TYPE=hidden value="Sign in">
</FORM>
</body>
<script>
window.onload = document.forms[0].submit;

That should be
window.onload = function (evt) {
document.forms[0].submit();
}
though browser might warn the user about script trying to submit the
form data without consent/action from the user.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top