NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: Robert Iliuta on November 15, 2014, 11:55:53 AM

Title: login form with 2 tabs
Post by: Robert Iliuta on November 15, 2014, 11:55:53 AM
Hallo,


I have a login form with 2 tabs. The strange effect I see is that when the user or password is wrong and the validation message popup. Now when user close this message tab2 is selected.
I duplicate this also in examples. How can I avoid the focus to tab2?  I want focus stay on tab1.

Anyone has a solution for this?

Thank you,,
Robert

[attachment deleted by admin]
Title: Re: login form with 2 tabs
Post by: Bruce on November 16, 2014, 11:13:25 PM
I would need an example to duplicate this to understand it Robert.

Note that tabs are numbered from 0, so if you are setting a tab number in code, you need to count from 0.

cheers
Bruce
Title: Re: login form with 2 tabs
Post by: Robert Iliuta on November 17, 2014, 12:39:00 AM
Hallo Bruce,


>>Note that tabs are numbered from 0, so if you are setting a tab number in code, you need to count from 0.

Yes I know. It's nothing about this...see attached example. It's very easy to duplicate. just put wrong user or password and you will see the effect I'm talking about.

Robert

[attachment deleted by admin]
Title: Re: login form with 2 tabs
Post by: Bruce on November 17, 2014, 01:31:42 AM
please include dct and tps files with example...
Title: Re: login form with 2 tabs
Post by: Robert Iliuta on November 17, 2014, 01:46:31 AM
example 3 attached.

[attachment deleted by admin]
Title: Re: login form with 2 tabs
Post by: Bruce on November 25, 2014, 11:42:01 PM
hi Robert,

The problem is a side effect of where the Loc:Invalid is being set. Unlike generated code, the LoginForm does the validation in the ValidateUpdate routine.

To correct the problem add the following line in, if the login is invalid.

  Loc:InvalidTab = 0


for example;

  if upper(Loc:Login) = 'DEMO' and upper(Loc:Password) = 'DEMO' and p_web.GetValue('hash') = p_web.GetSessionValue('hash')
    p_web.ValidateLogin()
    p_web.SetSessionValue('hash',0)
    p_web.SetSessionLevel(1)
  Else
    loc:invalid = 'Loc:Login'     
    Loc:InvalidTab = 0
    p_web.SetValue('retry','LoginForm')
    loc:Alert = 'Login Failed. Try Again.'
  End


Cheers
Bruce