How to change form state manually?

I want to change the form state according to my custom code.
when I click submit button it runs my javascript code. But even I set the display property of the error state to display, it automatically displays the success state form. Not displays the error state.
Please help me to resolve this?

Here is my site Read-Only: LINK
(how to share your site Read-Only link)

Hi @Lasitha, thanks for your post.

Could you help to share your read only link for the project with the form and page name?

Learn how to share a project’s read only link: Share a read-only link | Webflow University

Thanks in advance :slight_smile: