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
|
|
|
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.
|
|
|