NetTalk Central

Author Topic: Clearing the login and password fields on a form if wrong codes entered.  (Read 4636 times)

Richard I

  • Sr. Member
  • ****
  • Posts: 399
    • View Profile
    • Email
Hi All,
In NT Server Example  3
the login form contains the two fields-
 loc:login and loc:password


I want these two fields loc:login and loc:password to display clear ie blank ,if the login  condition fails.
How can I achieve that please?
Although this code runs the fields are still populated ...?
Thanks
Richard
NT 11.04


In validate Update ...
if p_web.Authenticate(Loc:Login,Loc:Password) = true and p_web.GetValue('hash') = p_web.GetSessionValue('hash')
  p_web.ValidateLogin()
  p_web.SetSessionValue('hash',0)
Else
  loc:invalid = 'Loc:Login'
  p_web.SetValue('retry','LoginForm')
  loc:Alert = 'Login Failed. Try Again.'
End

Richard I

  • Sr. Member
  • ****
  • Posts: 399
    • View Profile
    • Email
Re: Clearing the login and password fields on a form if wrong codes entered.
« Reply #1 on: January 19, 2019, 06:30:24 PM »
Got it with this-
but, is there a better way?
Thanks Richard
In validate Update...
IF p_web.GSV('AccessLevel') < '300'     
     loc:invalid = 'lPassword'
     p_web.SetValue('retry','LoginForm')
     loc:Alert = 'The Printing of TimeSheets is not Permitted at your Level'
     p_web.SetMessage('You are Not Eligible to Print TimeSheets','',false)
     p_web.SetValue('lPassword','')
     p_web.Storevalue('lPassword')
     p_web.SetSessionValue('lPassword','')
END

DonRidley

  • Don Ridley
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 729
  • donaldridley2011@gmail.com
    • View Profile
    • Email
Re: Clearing the login and password fields on a form if wrong codes entered.
« Reply #2 on: January 20, 2019, 09:06:38 AM »
What about:

IF p_web.GSV('AccessLevel') < '300'     
     loc:invalid = 'lPassword'
     p_web.SSV('loc:login','')
     p_web.SSV('loc:password','')
     p_web.SetValue('retry','LoginForm')
     loc:Alert = 'The Printing of TimeSheets is not Permitted at your Level'
     p_web.SetMessage('You are Not Eligible to Print TimeSheets','',false)
END
"Eliminate the impossible, whatever remains, however unlikely, must be the truth."

NetTalk 12.55
Clarion 11