NetTalk Central

Author Topic: Logout form embed code  (Read 3318 times)

rupertvz

  • Sr. Member
  • ****
  • Posts: 326
    • View Profile
    • Email
Logout form embed code
« on: September 05, 2012, 01:47:17 PM »
Hi Guys,

I am using the LogoutForm from the example application.
It has the option "Are you sure you wish to log-out? Please click "YES" to log-out"

The two options buttons are defined by Generate From, Start
p_web.site.SaveButton.TextValue = 'Yes'
p_web.site.CancelButton.TextValue = 'No'


In ValidateUpdate, End, the following code logs out the user session;
p_web.SetSessionLoggedIn(0)

How do I add a condition to the logout code, NOT logout should the user select 'NO' ?
p_web.SetSessionLoggedIn(0)

Thanks
Rupert

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Logout form embed code
« Reply #1 on: September 05, 2012, 11:16:21 PM »
Hi Rupert,

can you remind me which example you're looking a? I know one of them has that option, but most don't.

The approach "works" because the Cancel button ("no") does not trigger a ValidateUpdate.

If it's not actually working in the example, then there's a bug or something I need to look at. So let me know the example name.

cheers
Bruce

TimR

  • Newbie
  • *
  • Posts: 28
    • View Profile
Re: Logout form embed code
« Reply #2 on: October 17, 2012, 09:10:23 PM »
One example is in web3.app and it appears to work as advertised (if you don't want to logout, you don't get logged out)