How to code button item to close window

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
User avatar
rudy
Mega User
Mega User
Posts: 161
Joined: Thu Jan 15, 2004 11:39 pm
Location: Scottsdale, Arizona
Contact:

How to code button item to close window

Post by rudy »

I have a menu item named "Logout" and would like to know how to code this so it just closes the page that the menu is on, not link to another page.

I thought this was the javascript code but I must have something wrong - it doesn't work.

Code: Select all

aI("text=Logout;oncolor=#FF0000;offcolor=#000000;URL=javascript:myfunction('window.close');")
Rudy
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Re: How to code button item to close window

Post by Ruth »

Hi Rudy,

Well, I tried this, even tried actually creating the function and like you couldn't get it to work, even if the function is at the top of the data file and also on the page itself. I did find a way to get it to work, but couldn't test it in anything but IE and an old FF. It worked in IE not in the old FF which gave me ' Scripts may not close windows that were not opened by script.' So, I'll give you want I have and you can test in newer versions. This is set up in the download menu so it uses the colors from that for the 'class' I set up.

Code: Select all

aI("text=<form><input type=button class=button value='Logout' onclick=window.close() /></form>;type=form;");
and the class is

Code: Select all

.button{background-color:#eeeeee;font-size:10px;width:50;border-width:0px;cursor:hand;}
It doesn't really look like a button because of the class i created. Other than that, I think you'll have to contact Milonic about how to do this.

Ruth
Post Reply