Web Analytics Made Easy -
StatCounter Why won't this work? - CodingForum

Announcement

Collapse
No announcement yet.

Why won't this work?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Why won't this work?

    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?

  • #2
    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.

    Comment


    • #3
      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?

      Comment


      • #4
        Have you tried:

        <FORM TARGET="frameName"...
        Quيet Storm Designs ~ Art is not what you see, but what you make others see.
        · the Storms· || ·Ultraviolent Winter· || ·Was Einstein Wrong?· || ·It´s About Time!·

        Comment

        Working...
        X