Strange issue with server-side validation

Hi,

So I have set up server-side validation to ensure the username does not already exist.

My first issue is that the message is not being displayed under the input when the validation fails.

I have confirmed that the JS required is present.

and the linked field is correct.
(server-side)
image

(client-side)
image

I verified that I am receiving the response.

In console, I see the following.

So, I added a custom alert on the validation fail.


image

When I try now, everything seems to be 1 step behind. Best way to show this is in the vid here.
The email address I try to use should fail as it does exist on the database.

So, why is the message not showing under the input and which is the alert 1 step behind?

If anyone can help shed some light on this, I would be grateful.

Ray.

Try wrapping the input in a form group, am sure this is how we rectified this issue once before? Worth a go! :slight_smile:

Sorry, should have included this screenshot.

Hmm very odd, sorry Ray, this might be one for George or Teodor.

@Teodor or @George have you seen this behaviour before I have shown in the video?

For the bootstrap form add validation to the text input (such as required) this should allow the error message to show.
For the alert: rather than using the ‘Run’ step in the flow, you can use a dedicated Server Connect step.


I tend to use status as I think the lastError property changes depending on what stage of the XHR process it is.
You can give it a name (such as sc1) and then access it in your condition as sc1.status == 200
then -> do whatever for successful (add a comment if nothing)
else -> do whatever for failed