Closed Thread Icon

Topic awaiting preservation: form in external window (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=8610" title="Pages that link to Topic awaiting preservation: form in external window (Page 1 of 1)" rel="nofollow" >Topic awaiting preservation: form in external window <span class="small">(Page 1 of 1)</span>\

 
quisja
Paranoid (IV) Inmate

From: everywhere
Insane since: Jun 2002

posted posted 04-19-2003 13:34

What I want to do is have a function that will open a window (got that) with a precpecified, off-site document (i.e. I can't modify the page I am loading). However this page has a form on it, and I want to be able to fill in some of the values of the form with ones I specify. I've searched google but any attempts to reference the external window have failed. Here is my code so far:

function opengb() {
gbook = window.open ("url.com", "gb", "toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=500,height=500");
gbook.form.name.value = "predeterminedvalue";
}

poi
Paranoid (IV) Inmate

From: France
Insane since: Jun 2002

posted posted 04-19-2003 17:09

quisja: You forgot that the FORM element is nested in the DOCUMENT, thus your function should be:

code:
function opengb{
gbook = window.open ("url.com", "gb", "toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=500,height=500");
gbook.document.theFormElement.theFormFieldElement.value = "predeterminedvalue";
}



Notice that for some security reasons, it's not possible ( via the normal way ) to alter the properties of a document coming from another domain.

Cheers,

Mathieu "POÏ" HENRI

quisja
Paranoid (IV) Inmate

From: everywhere
Insane since: Jun 2002

posted posted 04-19-2003 20:15

Hence I get an "access denied" error message when I try to do that. What are these abnormal ways that you speak of then..?


home

Scott
Bipolar (III) Inmate

From: schillmania.com
Insane since: Jul 2002

posted posted 04-21-2003 01:07

It's possible you may be able to append parameters in the URL to fill out the form fields - that way you don't have to worry about cross-domain scripting security issues etc.

eg. somedomain.com/somepage?userName=mrMagoo

Where the name matches a form input element tag name.
I could be completely wrong about this but I vaguely recall trying something like this once.

quisja
Paranoid (IV) Inmate

From: everywhere
Insane since: Jun 2002

posted posted 04-21-2003 13:05

Hmm, nope, no workie... oh well, I'll have to look at doing this a different way...


home

« BackwardsOnwards »

Show Forum Drop Down Menu