Forums

Problems with the loop when entering wrong verication code

AntonioGraca 23 Oct, 2013
Hello, Bob

I have a problem when entering wrong verication code in the form. The problem is as follows:
When the form is loaded, some fields are automatically filled from a costum code in the OnLoad event. Alright. But after filling the all form and enter wrong code verification (Check Security Question), contents field filled automatically disappear. I think is in Event Loop. I've tried to put a costum code (with same code witch is in OnLoad, to fill again automatically the fields) within the Security Question Check in OnFail (before or after of EventLoop) but not results. When the user fail on the code varification, the fields that had been automatically filled are empty now.

Can you help?

Thanks
António Graça
AntonioGraca 25 Oct, 2013
Hi,Bob
Continuation...
After the loop, if I click the Cancel button (back button) data were entered automatically return to fill in the field again. :?

How to solve?


António Graça
GreyHead 25 Oct, 2013
Hi Antonio,

If I understand the problem correctly then your custom code needs to detect if this is the first form load or a re-load. And not set any values if it is re-loading! You could set a value in a hidden input at the end of your custom code and check that. If the value is set then the form is re-loading.

Bob
AntonioGraca 26 Oct, 2013
Hello Bob

your custom code needs to detect if this is the first form load or a re-load. And not set any values if it is re-loading!


Im not sure if Bob understood well ...
At load event, is a custom code that populates only some form fields. On submit the form is two check: to detect if the record already exists and detect if the security code entered is correct.
1. If the record exist displays a message warning, make reload, and fields before filled with custom code are empty.
2 . When there is error in the introduction in check security code, the form is re -load. And when is reload the custom code no longer fills fields, i.e., the fields populate before with costum code are empty.
3 . But what I want is that the fields are always filled with information that I carried in custom code.
4 . The problem is, every time there is an error (record already inserted in the data table or error in the verification code) the form reload and the contents of the fields that had previously been loaded with custom code disappears.
5 . Where to put custom code so that when the form is reload fields are always filled ?

Thanks Bob

António Graça
GreyHead 26 Oct, 2013
Hi Antonio,

In the OnLoad event before the Show HTML action.

Bob
AntonioGraca 29 Oct, 2013
Hello Bob

The custom code that automatically populate fields was already in the onload event before the Show HTML. The order is as follows:
In OnLoad Event
1º The Custom code that will automatically fill the fields;
2º Custom code with JavaScript to become the fields, that were filled, read only;
3º Custom Datepicker;
4º Two DB Multi Record Loader;
5º Load Security Question;
6º Load CSS;
7º Form Style.

In Submit Event
1st Security Question Check, inside Check Secur., OnFail, Event Loop;
2nd DBSave;
3rd Show Thanks.

(1st picture) - When the form loads with fields filled;
(2nd picture) - After entering the remaining field, introduce the verification code. When code is wrong fields, before introduced with costum, code are no data;
(3rd picture) - But if I then click cancel, return to populate data fields.

When the form is Reloaded the Costum code dont populate the field (2nd picture). What is wrong?

Tanks
António Graça
firozihs 20 Nov, 2013
Hi antonio,
I think you should copy the custom load event's code to all form's load event as well as the wrong verification code event. I hope it will work.
firozihs 20 Nov, 2013

Hello, Bob

I have a problem when entering wrong verication code in the form. The problem is as follows:
When the form is loaded, some fields are automatically filled from a costum code in the OnLoad event. Alright. But after filling the all form and enter wrong code verification (Check Security Question), contents field filled automatically disappear. I think is in Event Loop. I've tried to put a costum code (with same code witch is in OnLoad, to fill again automatically the fields) within the Security Question Check in OnFail (before or after of EventLoop) but not results. When the user fail on the code varification, the fields that had been automatically filled are empty now.

Can you help?

Thanks
António Graça



I think you should copy the custom load event's code to all the form's load event as well as the security question check event.
AntonioGraca 21 Nov, 2013
Hello,firozihs
Thanks for the reply, but I could not understand well the idea. :? Would you mind explain what you propose?

Thanks
António Graça
AntonioGraca 21 Nov, 2013
Hello Bob
I still can not solve this problem. One issue, the Event Loop not always shows the options Target Event (see the picture). Does after the error the loop goes to the Load Event?

Thanks
António Graça
This topic is locked and no more replies can be posted.