NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: ianburgess on June 23, 2012, 12:34:33 AM

Title: Conditional URL on Save
Post by: ianburgess on June 23, 2012, 12:34:33 AM
I have a Login form and currently the template had "IndexPage" as the URL on Save. I need to go to a different URL according to who has logged in. How can I set a conditional URL on save?  I tried embedding code to set LOC:Formaction just after the template sets it, but the embed point was too early to take account of the login.
Title: Re: Conditional URL on Save
Post by: DonRidley on June 23, 2012, 07:18:37 AM
Use a variable (see screenshot) and place your code here:

SetFormAction  routine
  data
! Start of "Set Form Action"
! [Priority 5000]

! End of "Set Form Action"
  code
  ! Start of "Set Form Action"
  ! [Priority 5000]
  !----------------------->>>>>>>>>>>>>>CODE HERE <<<<<<<<<<<<<<<------------------------------------
  ! End of "Set Form Action"
  loc:FormAction = p_web.GetValue('onsave')
  If loc:formaction = 'stay'
    loc:FormAction = p_web.Requestfilename
  Else
    loc:formaction = 'IndexPage'  !<<<<<<------variable will appear here
  End

[attachment deleted by admin]
Title: Re: Conditional URL on Save
Post by: ianburgess on June 23, 2012, 10:00:33 AM
Many thanks - I will give that a try.