Server Side Validation Error

Hi,

I have just tried to use server side validation, however I am having errors thrown up in the console.

I’m not sure what i’m doing wrong, so any help debugging this would be grateful.

Validation

Console

XHR

serverconnectForm.js
image

I’m sure it’s something stupid, but I have been looking at it so long I just can see what I’m doing wrong.

Thanks,
Ray.

1 Like

Is that the Id or the input name in the Linked Field box? It should be input name

Also check that the dmxConnectLib/lib/validator directory is uploaded

Hi Brian,

Now, here’s the funny thing, I don’t even have a dmxConnectLib folder in my local folders, let alone on the live server.

image

When I added a server side validator, should this have been created on my local side?

Ray.

I would have expected to see this.

image

Just noticed you are using .net, may be different to PHP

The error is client-side, server-side returns a 400 status with the error in the json response, the javascript is then generating the error.

Do you have the dmxValididator.js file included on the page?

The dmxConnectLib folder is not available with .NET, it has all the libraries compiled in DLL files located in the Bin folder.

Thanks @patrick.

I thought this would have been added automatically?

Ray.

Hello there,

I now understand the 400 status that I’m getting by having added a server-side validation.

Yet, I don’t understand the solution, as in my project folder I do have Validator.php in dmxConnectLib.

Should I add to the page the following?
script src="…/dmxConnectLib/lib/validator/Validator.php"

Just for curiosity, it’s not a critic, shouldn’t libraries being added automatically?

Thanks,

Mag

You may need to upload the files for Validator contained within your ‘dxAppConnect’ directory… Infact it is a good idea to upload the entire directory every now and again. May also need to flush cache in the browser, CloudFlare, and NGINX etc.

<link rel="stylesheet" href="../dmxAppConnect/dmxValidator/dmxValidator.css"/>
<script src="../dmxAppConnect/dmxValidator/dmxValidator.js" defer=""></script>

Obviously the paths above are for our deployment, yours may differ so just check them to be certain… :wink:

They are added automatically but still, in some situations, may require uploading. Especially if working locally.

1 Like

Thank you Dave for taking the time to reply.
Got the error, for anyone eventually running in silly but annoying slips:

To solve the issue, I’ve checked the ‘No Auto Load’ option so that the component does not run the server action when the page first loads.

In fact, the server-validation was based on some form input, still empty of user inputted data when the page loads.

Hope this helps, Happy coding with Wappler to all.

1 Like