NetTalk Central

Author Topic: SetFormAction routine  (Read 3380 times)

oggy

  • Full Member
  • ***
  • Posts: 219
    • View Profile
    • Email
SetFormAction routine
« on: October 04, 2011, 04:07:04 AM »
I need to change SetFormAction routine...
After some hours of examinating, I decide to omit default SetFormAction routine and call my SetFormAction from within local routine, with some condition:
Example:
If loc:logok = 1
  loc:FormAction = p_web.GetValue('onsave')
  If loc:formaction = 'stay'
    loc:FormAction = p_web.Requestfilename
  Else
    loc:formaction = 'IndexPage'
  End
  if p_web.IfExistsValue('ChainTo')
    loc:formaction = p_web.GetValue('ChainTo')
    p_web.SetSessionValue('LoginForm_ChainTo',loc:FormAction)
    loc:formactiontarget = '_self'
  ElsIf p_web.IfExistsSessionValue('LoginForm_ChainTo')
    loc:formaction = p_web.GetSessionValue('LoginForm_ChainTo')
    loc:formactiontarget = '_self'
  End
  If loc:FormActionTarget = ''
    loc:FormActionTarget = '_self'
  End
  If loc:formaction = ''
    loc:formaction = lower(p_web.getPageName(p_web.RequestReferer))
  End
  loc:FormActionCancel = 'Login.html'
  loc:FormActionCancelTarget = ''
end
-------------------------------------
but this didnt work...
My goal to call 'IndexPage' only when condition (loc:logok) is true...
After fetching data from logging database, loc:logok is set to true, I check this out, but local routine did not open IndexPage as expected....
Any hint on that?


kevin plummer

  • Hero Member
  • *****
  • Posts: 1195
    • View Profile
    • Production Accounting and Software Payroll
Re: SetFormAction routine
« Reply #1 on: October 04, 2011, 07:03:40 PM »
Rather than changing this I would do the validation in the _sendFile embed in the web handler in which you can simply serve up a different page than what was called. Bruce describes the method in his book - Building Web Apps.

I used recently and it works a treat!

oggy

  • Full Member
  • ***
  • Posts: 219
    • View Profile
    • Email
Re: SetFormAction routine
« Reply #2 on: October 04, 2011, 09:55:54 PM »
Any link to that?

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile