Handlebars validate button Submit

Asked

Viewed 23 times

-1

Hello,

need to do a check using handlebars...

after clicking the sign up button, if the registration is successful, displays a modal

otherwise the user is forced to fill in the fields,

however I only want to display the modal if Submit is done...

I’m using an onclick logic, so every time I click the button ....

even if there is an error in the form the modal is displayed ...

does anyone know if via handlebars I can solve this problem with if Else? or will I have to work logica on JS

Follow the code below:

Javascript

inserir a descrição da imagem aqui

Html

inserir a descrição da imagem aqui

Thanks in advance

  • With handlebars gives also, since you send something from the back end to validate, I find it easier to do this on the front with javascript, now you have to see what you want to do, because when you submit the form you are automatically redirected, I think you can not do as you want to do!

1 answer

0

I solved the problem using addEventListenet('Submit');

but no handlebars would be possible ?

thank you in advance

Browser other questions tagged

You are not signed in. Login or sign up in order to post.