Display Dynamic Message Using DMX-BS4-Alert

I would like to display the error message when an email exists in the database. I have it set up, but the error message is not displayed. It’s most likely due to something I’m not doing correctly. Please see the image below.

dmx-on:error=“alert2.show();alert2.setType(‘warning’);alert2.setTextContent(inp_username.validationMessage)”

Then default action for this is for the message be be shown in the validation message of the form input (i.e. just below the Email address input)

To do this you set the field name of that field in the Validate Data step of the server action

image

1 Like

I finally saw my error. The input field was an email type. I misread it as the name. Once I corrected this. The error shows beneath the field.

This small error message is okay, but how does this error message show up in the BS4 Alert? Or is it not possible?

Yes i to be nice to have a notification pop up at the same time but I am not aware of a methiod, the validation message does not seem to be exposed to the picker

Maybe it could be input manually with something like
formname.data.validate_mail or formname.data.validate_mail.value

within the error server Connect Dynamic Error action

Just a guess, have not tried

Thank you. I’ve just resolved to reformat the HTML to allow the error to show as it is. I just added a text-danger to show the message. It seems to display the error sufficiently.

I was just under the impression that it would function like the server success alert. It would be nice to have all the alerts show up in the same place on the screen!

I appreciate your input!