NetTalk Central

Author Topic: load different form if login fails  (Read 4665 times)

HPabon

  • Newbie
  • *
  • Posts: 20
    • View Profile
    • Email
load different form if login fails
« on: June 06, 2012, 08:05:20 PM »
Hi,

I have a form which allow the user to try to login up to three times. This form is called 'LoginForm'.

If the log in fails after three opportunities, I want to open another different form in the browser. The new form is called 'LoginFail'.

Any idea on how to to this?

Appreciate any help.

Hector

Robert Iliuta

  • Sr. Member
  • ****
  • Posts: 472
    • View Profile
    • Email
Re: load different form if login fails
« Reply #1 on: June 06, 2012, 08:47:34 PM »
Hallo Hector,


Did you try this?

Code: [Select]
p_web.Script('window.location.href="LoginFail?";')
Robert

JohanR

  • Sr. Member
  • ****
  • Posts: 375
    • View Profile
    • Email
Re: load different form if login fails
« Reply #2 on: June 07, 2012, 02:51:01 AM »


Hi Hector


Not sure I should be helping anyone with NTWS, but here is what I would try. <g>

Set a counter either in the session queue, or in a login file that keeps track of attempted logins.

Have 2 tabs on the form that has a "Tab Condition"  eg.
VALID tab - p_web.GSV('login_counter') < 3
INVALID tab - p_web.GSV('login_counter') => 3

and set the condition according to the situation, and the correct tab will show.

Ideally this should be handled in your tps file that keeps track of the username, or the user will simply start a new session and retry.


Johan



HPabon

  • Newbie
  • *
  • Posts: 20
    • View Profile
    • Email
Re: load different form if login fails
« Reply #3 on: June 07, 2012, 08:01:21 PM »
Robert,

I tried what you suggest but get the following HTML source:

 <script defer="defer">
window.location.href="NewsBrowsePage?"
</script>
HTTP/1.1 200 OK
Date: Fri, 08 Jun 2012 03:53:57 GMT
Server: NetTalk-WebServer/5.47
Expires: Thu, 09 Jun 2011

With the rest of the HTML page.



Robert Iliuta

  • Sr. Member
  • ****
  • Posts: 472
    • View Profile
    • Email
Re: load different form if login fails
« Reply #4 on: June 07, 2012, 09:18:38 PM »
which embed did you try?

try on embed: GenerateForm > 6 After</form> put here the condition and code and try again.

Robert

HPabon

  • Newbie
  • *
  • Posts: 20
    • View Profile
    • Email
Re: load different form if login fails
« Reply #5 on: June 08, 2012, 07:12:53 PM »
Robert,

Now it works. :)

Many thanks for help with this one.