CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 Confirm Logout

Print topic Send  topic

Author Message
datadoit.com
Posted: 08/18/2004, 11:55 AM

How can I confirm the user wants to log out with a popup? I have a link
control for Logout. I have put in an OnClick event that looks like:

Javascript: confirm('Are you sure you want to log out?');

However, answering OK or Cancel will log the user out.

TIA.

-MikeR

sweiss

Posts: 22
Posted: 08/18/2004, 11:38 PM

This could be a soloution

<a href="your_logout_page.php" onclick="return confirm('Do you really want to Log Off?');">Logout</a>

Stefan
View profile  Send private message
datadoit.com
Posted: 08/19/2004, 8:46 AM

This works great! Thanks.

Now is there a way to make the confirm box title to be something other than
[Javascript Application] ?

[Javascript Application] <--- Would love to be able to change this!

Are you sure you want to log out?

OK Cancel



"sweiss" <sweiss@forum.codecharge> wrote in message
news:541244adc1d0e7@news.codecharge.com...
> This could be a soloution
>
>
<a href="your_logout_page.php" onclick="return confirm('Do you  
really  
> want to Log Off?');">Logout</a>
>
> Stefan
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>

datadoit.com
Posted: 08/19/2004, 11:52 AM

I just noticed that it only says [Javascript Application] in Mozilla
Firefox. IE shows 'Microsoft Internet Explorer'. Still though, is there a
Javascript way of controlling this dialog title?


"datadoit.com" <mike@datadoit.com> wrote in message
news:cg2i0f$vnv$1@news.codecharge.com...
> This works great! Thanks.
>
> Now is there a way to make the confirm box title to be something other
than
> [Javascript Application] ?
>
> [Javascript Application] <--- Would love to be able to change this!
>
> Are you sure you want to log out?
>
> OK Cancel

DonB
Posted: 08/19/2004, 10:12 PM

Do it server-side. Redirect to a separate page with the confirm question
and the code to logout. Have that page redirect back to the login page if
you like.

--
DonB

http://www.gotodon.com/ccbth


"datadoit.com" <mike@datadoit.com> wrote in message
news:cg08n0$qst$1@news.codecharge.com...
> How can I confirm the user wants to log out with a popup? I have a link
> control for Logout. I have put in an OnClick event that looks like:
>
> Javascript: confirm('Are you sure you want to log out?');
>
> However, answering OK or Cancel will log the user out.
>
> TIA.
>
> -MikeR
>
>

NR
Posted: 08/22/2004, 8:08 PM

Or do it with a function in the same page:
<script language="JavaScript">
function do_confirm()
{
var agree=confirm("'Are you sure you want to log out?");
if (!agree) {
window.location.reload();
alert("Logout canceled");
}
}
</script>

In the link or logout button put:
onclick="do_confirm()"

As far has I kown there is no way to change the alert window title.

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.