padmapraveen_vasili Posted December 26, 2008 Share Posted December 26, 2008 Hi,I have 5 over ride buttons, whihc calls the javascript to open a pop up window.1.plants OR2.animals OR3.Seasons OR4.Elements OR5.Misc ORall the above are buttons.when i click the planst OR buttons, it is opening a pop up window.and when i clcik the same button for second time.i am getting the other override window.my first query is, how can i open a pop only once for this scenario.second query. when i click the Elements OR, it has to show the pop screen on to the top. presently it is out of select behind eteh applciation.code:--actionName="LoadOverRide"; url="LoadWaitImage.do?target="+actionName+"&dispatch="+dispatch+"&strOverrideName="+type; document.forms[0].target.value=actionName; window=window.open(url,"","width=920px,height=450,top=70,left=100px,toolbar=no,location=no,menubar=no,scrollbars=yes,status=yes,title=yes,resizable=yes");please help me...thanks in advancepraveen Link to comment Share on other sites More sharing options...
jeffman Posted December 26, 2008 Share Posted December 26, 2008 If I understand you:Every time you click a button, a unique window opens. This could create 50 windows! What you want is for the window to open exactly once, and then every click puts new content in the existing window. Yes? This is easy. Pass a name for your window (not a target, like _top) in the second argument of window.open(). Don't just pass an empty string, the way you are doing now.To bring a window to the front, call window.focus() Link to comment Share on other sites More sharing options...
padmapraveen_vasili Posted December 26, 2008 Author Share Posted December 26, 2008 If I understand you:Every time you click a button, a unique window opens. This could create 50 windows! What you want is for the window to open exactly once, and then every click puts new content in the existing window. Yes? This is easy. Pass a name for your window (not a target, like _top) in the second argument of window.open(). Don't just pass an empty string, the way you are doing now.To bring a window to the front, call window.focus()...Thanks alot for the quick response.the issue 1 got resolved..i can now see only one window at a time..like..any one of the over ride.but, when i click the second one, the window gets load with the clicked.but not able to gett it on to the top.function accountOverride(type,dispatch){ actionName="LoadOverRide"; url="LoadWaitImage.do?target="+actionName+"&dispatch="+dispatch+"&strOverrideName="+type; document.forms[0].target.value=actionName; orwindow=window.open(url,"overridewindow","width=920px,height=450,top=70,left=100px,toolbar=no,location=no,menubar=no,scrollbars=yes,status=yes,title=yes,resizable=yes"); } Link to comment Share on other sites More sharing options...
jeffman Posted December 27, 2008 Share Posted December 27, 2008 Try adding orwindow.focus(); to the end of that function. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.