atferraz
05-03-2004, 05:24 PM
Hello, I want to target a iframe with a button event, like
onClick = ‘open this page in that iframe’
href element has the target property, but there isn’t any of this in the button element.
thanks
Garadon
05-03-2004, 05:32 PM
onclick="document.frames['framename'].location=page;"
more or less
glenngv
05-04-2004, 05:34 AM
or:
onclick="window.open('urlOfPage', 'nameOfTargetIframe')"
brothercake
05-04-2004, 07:34 AM
The <form> element has a target attribute - if you used that with a submit button you could do it without javsacript.
glenngv
05-04-2004, 07:48 AM
atferraz just wanted to open a particular page in an iframe. So, submitting the form with a target is not a better approach especially if the main page is also being submitted normally (without target).
atferraz
05-04-2004, 09:59 PM
I’m sorry. Forgot to mention that the target iframe is on a page.
My default page has a iframe with id=name = “main”.
I loaded a page in that main iframe.
That page has its own iframe with id=name=”temp”. It also has a button that opens a modal Dialog window, where some data is selected.
When that modal dialog gets closed, return an array to its handler with the selected data witch I want to send to the “temp” iframe. So, at this point the data is on client side and I want to send it with url to the server, because the action form method didn’t work at all.
I can target the main iframe, but not the temp one.
onclick="window.open('urlOfPage', 'nameOfTargetIframe')" opens a new window.
onclick="document.frames['framename'].location=page;" only sees the main
thanks
:rolleyes:
glenngv
05-05-2004, 02:10 AM
Did you change 'nameOfTargetIframe' to 'temp'?