Dawn Theme, Show Login Form Errors Inside Custom Login Modal

I have built a custom login modal and want to show the incorrect password error inside the modal instead of redirecting to the account/login page. Any help would be greatly appreciated!,

Thanks..

EDIT**

I Copied most of the contents from the “customers/login.liquid” file and when the password is entered incorrectly it’s being redirected /account/login which shows the error, if you open the login modal the error is also displaying inside the modal, maybe I just need to modify the JS to refresh inside the modal instead of redirecting…? I wish code was as easy as saying that lol.

Solved with evennt.preventDefault() and fetch.

Hi @Lew2234 , thank you for asking this, I’m looking for a solution as well,

Can you please write where exactly did you use this event.preventDefault() and fetch?

on which event? the submit event of the form?

Did you have to use the regular HTML form or did you use the liquid ‘form’?

Thanks

Hi @Lew2234 Can you please let me know where to add this code? Thanks