Let's say I have this form in my page
<form id="myform" action="src/post.php" name="post" method="post" target="_blank">
<div id="editor"></div>
</form>
Which works flawlessly. But I need to use a button from another location in the same file to submit that form by ID. It's like a trigger command, but I believe it can only be achieved by Javascript.
Try next code
document.forms['post'].submit();