Server Side validation message not working - Validator.js present, Linked filed Name correct

Wappler Version : 3.0 rc3
Operating System : Windows 10

Expected behavior

When i create a server side validation step, i.e. to check if DB record exists, the validation message should appear on the client side if i have set it up correcttly.

Actual behavior

The server action works as expected (i.e. fails due to DB record already existing) but the message is not displayed on the client side.

Please note, i have checked the forum and my own work and believe everything is set up correctly.

To confirm:
the validator.js and css files are loaded in the head:

The Validation step has the linked field matching the Name of the input field that the validation step is set up on, see UI screen shot and also the code from the server action file:

And the code itself:

How to reproduce

Create a server action with a validate data step (DB record does not exist)
create custom message
see if it shows in client side.

Is anyone else getting this?

I know lots of people have had problems in the past, but it turned out it was their error (like not having the JS files loaded in the doc or not having the linked name filled out etc).

If someone could let me know if they have it working in the current beta version, I can continue troubleshooting…otherwise it looks like I’ve done everything right??

I think you are right.

Do you get a 400 error(Bad request) in the network tab instead of a response with the error messages?

What is the response from the server? Also please mention if your using PHP/ASP or NodeJS.

Thanks for the responses.

I’m using NodeJS and the server response is 400 error as Jon suggested.

Thanks, it looks like the validator in nodeJS is returning an invalid response. Will investigate this.

Thanks Patrick…
Just wasn’t sure if it was me or not…I’ll stop working on it and wait patiently :grin:

I believe the following update should fix it, replace the file /lib/validator/index.js with the one in the zip.

index.zip (1.1 KB)

1 Like

I think having to wait 4 minutes for an update is a bit too much to ask for… I really need it now :slight_smile:

j/k Thanks, i’ll check it out now.

Ok… So i don’t think that worked.

Updated the file, created a new validate data step just to be sure. Still getting 400 error. Although i believe there is more/different data in the console.

And here is the updated file you sent:

The server-side validation is now correct, the following problem is with the client-side. Here an updated app connect file, replace it in the dmxAppConnect folder.

dmxAppConnect.zip (21.8 KB)

This worked.

Thanks for this, much appreciated. It was my first time using sever side validation so was harder to tell if it was a bug.

All good now.

Worked for me too, thanks