NetTalk Central

Author Topic: Memory Form Save Button Operation When A Required Field Is Present  (Read 918 times)

GordonF

  • Jr. Member
  • **
  • Posts: 88
    • View Profile
Hi,

I have an unusual issue and it may just be that I'm doing something incorrectly.

I have a simple memory form called from a browse (no action), it has a text field, plus a save and cancel button. It all works fine until I set the text field to required, if after that I click save with an empty text field I get the required warning as expected, however if I then type a value into the text field and click the save (either with or without tabbing off the text field) the CompleteForm code runs but the form doesn't return to the caller it redraws itself with the text field being shown without the required required colouration, the second click on save again runs the CompleteForm code and returns to the browse. The result is my CompleteForm code which inserts a record into an unrelated table runs twice, what am I doing incorrectly.

Any advice would be much appreciated.


A quick update, the p_web.RequestReferer value gets set to the actual memory form name after the first failed required check, the solution was to store the initial p_web.RequestReferer value and set this as the save return url.

« Last Edit: March 07, 2023, 04:42:24 AM by GordonF »

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11155
    • View Profile
Re: Memory Form Save Button Operation When A Required Field Is Present
« Reply #1 on: March 07, 2023, 05:49:55 AM »
Hi Gordon,

An example showing the effect would be handy. Thanks.

Cheers
Bruce

GordonF

  • Jr. Member
  • **
  • Posts: 88
    • View Profile
Re: Memory Form Save Button Operation When A Required Field Is Present
« Reply #2 on: March 07, 2023, 07:11:23 AM »
Hi Bruce I will try to put together a simple example based on an example program tomorrow and send it to you.