Forum Moderators: open

Message Too Old, No Replies

Close all Child Windows

opened using target="_blank"

         

Mr_Brutal

3:26 pm on Jul 21, 2004 (gmt 0)

10+ Year Member



Hello,

I don't think this is possible due to the Security issues etc but what i'd like to do is this:

I used a page with a varying number of forms on it that auto submit themselves to a send email page. In order to auto submit them to the send email page i have had to open them using target="_blank" in the form tag. When they have all opened and finished emailing i want to close them all again. Is this possible?

Any ideas would be aprreciated - no problem if its not because i will eventually be able to get access to the send email form and write my own or write a better original page that has its own emal code but for now i want to try and do it this way?

Cheers in advance!

Rambo Tribble

4:35 pm on Jul 21, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I don't think you can do it using the target attribute, but if you use window.open(), you can assign the opened windows to variable names that you can then operate on from the opener.

Mr_Brutal

7:59 am on Jul 22, 2004 (gmt 0)

10+ Year Member



Thought so!

So can i use window.open() somewhere in the form tag like in the action attribute?

(Is this an obvious yes!)

Rambo Tribble

3:24 pm on Jul 22, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You could, by using the javascript: pseudo-URL to preface the window.open() command, though you might want to make it a function triggered by the onclick event of the submit button. That way, the function could return false, cancelling the regular submit function, but if JS was turned off, the regular submit would proceed (or if desired, return true and the submit will take place in addition to the function).

Mr_Brutal

3:36 pm on Jul 22, 2004 (gmt 0)

10+ Year Member



Cheers, i actually did get it working using javascript, using onLoad to submit all the forms to a name defined in a varaible. Which i then used to in a timeout to close the child window.

Lots of server side looping and vars.

Then i was informed that the PL/SQL has its own email package anway so i didn't need to use ASP submitted forms :-)

Thanks for the ideas though!