[Javascript] weird target behavior

Russell Scheinberg rscheinberg at lrk.com
Mon Jul 9 09:46:47 CDT 2001


I have a form with a link that opens a new window that displays several href's to choose from. These links send data parameters back to the original opener page and reloads the form with values from a database. Pretty basic stuff. What I want to happen is for the parameter to go to the original window and then the pop up window closes automatically. What happens now is kind of funny. The first time the original form is open, the link on the popup page opens a NEW window with the populated form in it instead of sending the info to the opener window. Then the popup window with the choices closes as it should. After that, all subsequent visits to the page with the choices, works as I want---the parameter are sent to the existing form and the popup closes. I have fought with this for a week and know that I've lost my perspective on it. Help would really be appreciated. Here is the code:

The code on the form that opens the "Clone" popup with links that works fine as far as I can tell:
javascript:newWindow=window.open('LRKLibClone.asp?txtTitle=A','','toolbar=0;menubar=0,1,locationbar=0,statusbar=0,personalbar=0,scrollbars=0,resizable=0,width=750,height=550');newWindow.focus()

The code on the page with the links that sends the info back to the original form:
<A HREF="/LibLRKAdmn/LRKLibAdd.asp?txtID=<%=oRSbt("ID")%>" TARGET=javascript:opener.window onClick="window.close()" STYLE="text-decoration:none"><%=oRSbt("Title")%></A>

As I said it works as intended the SECOND time you get the Clone window open. But the first time it pops up a new window instead.

Thanks.





More information about the Javascript mailing list