Create dynamic error message on different text fields

Hello,

I’m trying to build something quite simple to in javascript but I can’t find a way to do it in the wappler way.

I have this simple sign up form:


(it’s french but you got it: simple email and password)

My SC action checks if the email already exists, if it does it returns an error. It also checks if the password is well formatted (I know I could do that front end), if it’s not it returns an error.

So when a receive the error, I want to display it on the correct help text (email/password field) with the error message.

In code it would be something like:
if error.message == wrong email
then emailHelp.innerText = “Wrong email try again”
else if error.message == wrong password
then passwordHelpText.innerText = “Wrong password try again”

I was going to create a flow that is trigger by the dynamic event on the form with the Error Trigger but I can’t set a text value for the help texts, only for the input fields.

What is the correct way ? Use the “run javascript” action on the flow ?

Thanks

Community Page
Last updated: