266
Views
16
Comments
Why are my validaton messages not shown ?
Application Type
Reactive

Hello, 


I made validations to my sign up page but when I test it  I do not see the messages.

Anyone a hint what I have done wrong ?


Roelof


neo-social-place.oap
2020-09-01 10-42-42
Stefano Valente

Hi Roelof.


before you check if your form is valid you need to check if your inputs are valid. if not, set the isvalid = false and the message:


After your form = valid, you can do the save.

UserImage.jpg
Roelof Wobben

I did check but on another module.

Or do i misunderstood what you meant ?

2020-09-01 10-42-42
Stefano Valente

did you implement my print screens?

2020-09-01 10-42-42
Stefano Valente

I see what you mean.


Its always necessary to do the validation on the server side / backend side.

But if you want to have validation messages in the input widgets etc. you need to implement it client side, as show in my prints.

UserImage.jpg
Roelof Wobben

I thought I did already implement your screens

2020-09-01 10-42-42
Stefano Valente

Nope:

UserImage.jpg
Roelof Wobben

I cannot implement that code because at that point multiple inputs were checked.

you can see it if you follow the save-signup server action.


2020-09-01 10-42-42
Stefano Valente

you can check all widgets in one action and then see if your form is valid.

you can also implement tha validation in the onchange event of the widget.

2025-05-05 10-10-34
Vednarayan

Hi @Roelof Wobben 

You just add the message in your action flow.

Thanks and regards

Vednarayan

2024-06-13 07-53-34
Paulo Moreira
 
MVP

Hi Roelof,

I saw you're doing a lot of server-side validations for some of the fields on your form, which could be done on the client side, and therefore improve the usability and performance of your implementation.

I would suggest you change your logic in the following way:

  • Make the fields Name, Username, Password and Mobile mandatory on the Form on your screen
  • Implement validations on the SignUpOnClick screen action, on the Name, Username, Mobile and Password fields (lengths, format, etc.)
  • Change the Save_Signup in order to not perform the same validations you're doing on the screen action
  • Move the call to the Save_Signup server action after the If element, where the Valid property of the Form is checked
  • After the Save_Signup server action call, inspect the output parameter of this action Message, to check if the action was successful or not, and present a feedback message to the user

You can see a good example above, on Stefano's post.

Hope this helps.

Best regards,

Paulo Moreira

UserImage.jpg
Roelof Wobben

I know I did that for security reasons.

Every good hacker can change things on the client side so he/she gets data which she/he is not allowed to see.

And with the laws in Europe , you can get very big fines when you have a data leak.

2020-09-01 10-42-42
Stefano Valente

You are correct. you should always do your security checks and data/input validations both on client and server side.


Client side to provide fast and detailed information to the user on the screen. Backend to ensure security and data are valid on the server.

UserImage.jpg
Roelof Wobben

hmm., then I think im doing something not right. 

Rigth now my backend is also providing the error messages.


If I gave you a .oap could you look how that looks iike ?

2020-09-01 10-42-42
Stefano Valente

In traditional that will work just fine, because there was always interaction with the server.


But now we have Reactive and client actions, it is better to do it in client actions.

Send the oml and i will add a few possible validations:

You can do all validations in the send button, or you can do a field validation after the onchange event.

UserImage.jpg
Roelof Wobben

oke, it is then save for security reasons. 

I was always told that client side could be changed and exposing data.


I have already a lot of validations on the server side.

neo-social-place.oap
2020-09-01 10-42-42
Stefano Valente

i can't publish because you did not send the entire project and i have missing dependencies.


But you can still use my print screens.

If you want to do the validation on a field right after the change on the widget do it like this:



The Onsave:

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.