Hallo,
I would like to simulate the invalid message into a form where I need to check when the user press the save button. I have the bellow code in "Validate All" embed:
! Verifica daca a lasat spatiu liber la inceput
if MEM:Nume<>'' and sub(MEM:Nume,1,1)=' '
!mesaj ===============================================================
loc:invalid = 'MEM:Nume'
p_web.SetValue('retryfield','U_Membri')
loc:Alert = 'Ati lasat un spatiu liber la Nume, va rugam corectati!'
!=====================================================================
END
if MEM:Nume<>'' and INSTRING(' ',MEM:Nume,1,1)<>0
!mesaj ===============================================================
loc:invalid = 'MEM:Nume'
p_web.SetValue('retryfield','U_Membri')
loc:Alert = 'Ati lasat 2 spati libere la Nume, va rugam corectati!'
!=====================================================================
END
The code works ok but something strange is happening after the above code is generated. Example:
When user try to save the form and the above code is executed the message appear and and show to user where is the problem. The user corrected the problem and try to Save again the form. Now there will not be any error message but the Form is not closed it remain open. Doesn't matter you press Save or Cancel button. It doesn't return to Browse. I see on the WebServer Log that after the POST/U_Membri it open the form again GET/U_Membri ...... This is not happening if the above code is not executed.
I the above code is not generated the form closed correct and the browse appear.
Please help if anyone know what is wrong or if there is another method to display invalid message.
Thank you,
Robert