okkur / syna

Highly customizable open source theme for Hugo based static websites

Home Page:https://syna.okkur.org/demo/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Documentation Request] Editor Form Button How to?

zecbmo opened this issue · comments

Documentation Feature Request:

It would be great if you could add documentation on how to add delegates to the forms onSubmit function.

OnSubmit -> DoSomething

Thanks

Not really a Syna question. Take a look at javascript event listeners. An event listener can prevent the default function of the button and on submit run a specific function.

Something along the lines of

"document.querySelector(".editor-container").addEventListener("submit", function(e){
    if(!isValid){
        e.preventDefault();
    }
});