geuis
05-27-2003, 07:01 PM
I am trying to write a script that will trigger a submit() on a form in another window. I'm not sure what's wrong with the code I've written, but it always tells me permission denied. I've tried to follow the DOM as best I know how, but it still won't work. Any help is really appreciated.
p.s. the url in the window.open() is not the actual URL I am trying to get to submit, simply a placeholder. The website its trying to access has only 1 form that is unnamed, so should be accessible from forms[0].submit();
<html>
<script language="Javascript">
function test()
{
var newWin=window.open("http://somesite.com");
newWin.document.forms[0].submit();
}
</script>
<body onload="test();">
</body>
<html>
p.s. the url in the window.open() is not the actual URL I am trying to get to submit, simply a placeholder. The website its trying to access has only 1 form that is unnamed, so should be accessible from forms[0].submit();
<html>
<script language="Javascript">
function test()
{
var newWin=window.open("http://somesite.com");
newWin.document.forms[0].submit();
}
</script>
<body onload="test();">
</body>
<html>