Close Window

P

Paul Smith

I have found how to have a new page open in it's own window when a button is
clicked. But I do not know how to put a button on this to close this new
window when the users has absorbed the information.

If I have a hyperlink back to the referring page I end up with two pages
open.

How do I include a button which closes the new page window?

Paul Smith
 
S

Steve Easton

<input type="button" value="Close Page" onclick="window.opener = self; window.close()">

--
Steve Easton
Microsoft MVP FrontPage
95isalive
This site is best viewed............
........................with a computer
 
P

Paul Smith

I am not sure how to implement your solution....

How do I do what you suggest without trying to write my own code - I do not
do this.
 
S

Steve Easton

Sorry I should have posted more.

You paste ( in html view ) what I posted, in the place in the page you want the Close Page button to
appear.

What I posted is all you need.

--
Steve Easton
Microsoft MVP FrontPage
95isalive
This site is best viewed............
........................with a computer
 
P

Paul Smith

Is there anyway I can use one of the Interactive Buttons rather than the
boring 'standard' one?
 
S

Stefan B Rusynko

Yes
Insert an Interactive Button and for the hyperlink use

<a href="javascript:void();" onclick="window.opener=self; window.close();">

You will need to edit/enter the hyperlink code above in Code view
- initially set the link to javascript:void();
- then add the onclick event to it in Code view



| Is there anyway I can use one of the Interactive Buttons rather than the
| boring 'standard' one?
|
|
| | > Sorry I should have posted more.
| >
| > You paste ( in html view ) what I posted, in the place in the page you
| > want the Close Page button to
| > appear.
| >
| > What I posted is all you need.
| >
| > --
| > Steve Easton
| > Microsoft MVP FrontPage
| > 95isalive
| > This site is best viewed............
| > .......................with a computer
| >
| > | >> I am not sure how to implement your solution....
| >>
| >> How do I do what you suggest without trying to write my own code - I do
| >> not
| >> do this.
| >>
| >>
| >>
| >> | >> > <input type="button" value="Close Page" onclick="window.opener = self;
| >> > window.close()">
| >> >
| >> > --
| >> > Steve Easton
| >> > Microsoft MVP FrontPage
| >> > 95isalive
| >> > This site is best viewed............
| >> > .......................with a computer
| >> >
| >> > | >> >> I have found how to have a new page open in it's own window when a
| >> >> button
| >> >> is
| >> >> clicked. But I do not know how to put a button on this to close this
| >> >> new
| >> >> window when the users has absorbed the information.
| >> >>
| >> >> If I have a hyperlink back to the referring page I end up with two
| >> >> pages
| >> >> open.
| >> >>
| >> >> How do I include a button which closes the new page window?
| >> >>
| >> >> Paul Smith
| >> >>
| >> >>
| >> >
| >> >
| >>
| >>
| >
| >
|
|
 
R

Ronx

Yes, add the button to the page, set the URL to javascript:; A Hyperlink is
required to make it work in older browsers.
Then, in Code view add Steve's code to the link tag. The existing
onMousedown and onMouseup code can be removed since the window will close
before anyone can see the pressed image.

<a href="javascript:;" onClick="window.opener = self; window.close();return
false;" ><img border="0" id="img1" src="button9.gif" height="20" width="80"
alt="Close Window"
onmouseover="FP_swapImg(1,0,/*id*/'img1',/*url*/'buttonA.gif')"
onmouseout="FP_swapImg(0,0,/*id*/'img1',/*url*/'button9.gif')"
fp-style="fp-btn: Soft Rectangle 6; fp-transparent: 1; fp-proportional: 0"
fp-title="Close Window"></a>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top