PDA

View Full Version : Why won't this work?


Lee Brenner
06-27-2002, 12:23 AM
I have a form on "page2," "page2" resides in an iframe on "page1." Why won't the following code on "page1" work:

top.myIframe.myForm.submit();

I can set the values of the form elements on "page2" this way (i.e. top.myIframe.myForm.myTextField.value = "something"), but I can't programmatically submit the form. I get an "object doesn't support this method or property" error.

Any suggestions?

Lee Brenner
06-27-2002, 02:30 PM
You would think that would work, but it doesn't. Whether I use "top" or "self," I can set form values, call functions, etc...but I cannot call submit() on the form. Including "document" doesn't make a difference.

Lee Brenner
06-27-2002, 05:30 PM
I'm doing some pretty convoluted stuff between the main page, it's child window, and the page inside the iframe and I think my child window is actually the initiator of the function that calls the submit(). Perhaps for security reasons the child window can't call a function on the mainpage that calls a submit on a completely different page?

Quiet Storm
06-28-2002, 03:24 AM
Have you tried:

<FORM TARGET="frameName"...