NetTalk Central

Author Topic: Determine tab user is on  (Read 4001 times)

mtabakin

  • Jr. Member
  • **
  • Posts: 53
    • View Profile
    • Email
Determine tab user is on
« on: May 09, 2013, 08:19:16 PM »
I have a NetWebForm with 4 tabs (actually it is the SecwinWebLoginForm with the tabs: Login, Forgot Password, Create a Login and Set Password). I want to determine on which tab the user was on when they clicked a button on that tab. Where/how do I determine the tab?

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11244
    • View Profile
Re: Determine tab user is on
« Reply #1 on: May 09, 2013, 10:25:33 PM »
What tab-type are you using? Tab?
the "current tab number" is in
p_web.GetSessionValue('showtab_ProcedureName')
(Where you replace ProcedureName with the name of the procedure.)

mtabakin

  • Jr. Member
  • **
  • Posts: 53
    • View Profile
    • Email
Re: Determine tab user is on
« Reply #2 on: May 12, 2013, 07:48:50 PM »
I guess I didn't ask the right question. First to answer your question "what tab-type are you using"? My answer is whatever tab-type is used by the SecwinWebLoginForm because these are the procedures I imported into my app from the Capesoft NetTalk example "SecwinRequiresC6 (51).

I then added a Captcha field to the "Create a Login" tab again taking code from the Capesoft Captcha (61) example. My problem is that when NOT on the Create a Login "tab", for example when using the "Login", the code that verifies that the Captcha entered matches the Captcha image, is being executed and of course failing verification because no Captcha was entered (or needed to be entered because it is only for the Create a Login function). So I guess I have used an incorrect embed point.

I want the Captcha to only be used and needed when the user is on the "Create a Login" tab so where should verification code be embedded in the SecwinWebLoginform so it only is executed when the user is on the Create a Login tab and clicks the button on that tab?   

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11244
    • View Profile
Re: Determine tab user is on
« Reply #3 on: May 12, 2013, 09:55:42 PM »
maybe you need to post an example Mike.

cheers
Bruce

mtabakin

  • Jr. Member
  • **
  • Posts: 53
    • View Profile
    • Email
Re: Determine tab user is on
« Reply #4 on: May 13, 2013, 06:40:15 PM »
I've taken the Capesoft NT example "SecwinRequiresC6" and added the Captcha code, taken from your Captcha example to the SecwinWebLoginForm. I've added a Captcha field to the Create Your User Login tab.

In the SecwinWebLoginform procedure the two routines with Captcha embedded code are ValidateValue::loc:Captcha and Value::loc:image.

If you compile and run this app and just try to login using the demo/demo (username/password), NOT Create a new login, you'll get the warning that about Verification Required.

Clearly I do not understand why the ValidateValue::loc:Captcha routine is being called in the case of a standard login. The Captcha logic on the Create Your User login (tab) seems to work by itself without any issue, it's just that it also is called when using other tabs.

[attachment deleted by admin]

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11244
    • View Profile
Re: Determine tab user is on
« Reply #5 on: May 14, 2013, 04:37:34 AM »
Hi Mike,

>> If you compile and run this app and just try to login using the demo/demo (username/password), NOT Create a new login, you'll get the warning that about Verification Required.

which makes sense - When you complete the form all the fields are "validated" - and the fact that the field is on another tab is not going to make it less-validated.

I think what you want to do is move the validation code from the
ValidateValue::loc:Captcha  Routine
to the
Validate::EmailButtonNewUser  Routine

Note that the "current value" of loc:capatcha, as entered by the user, will then be in the SessionValue of loc:capatcha, not the local variable.

Cheers
Bruce


mtabakin

  • Jr. Member
  • **
  • Posts: 53
    • View Profile
    • Email
Re: Determine tab user is on
« Reply #6 on: May 14, 2013, 08:20:03 PM »
You learn something new every day. Thanks, your suggestion was the key to making it work!!!