I am trying to set the onClick attribute of a HTML button to a function written in the JavaScript. In the Classic Forms Designer, this could be done simply by putting the name of the function with brackets in the end - however, that's not working in the Modern Designer.
My HTML button:
<a class="btn btn-info" target="_blank" onclick="openWindow()">Function</a>
My JS:
const openWindow = () => { console.log("TEST"); }
When I run the form and click the button I get an error:
Uncaught ReferenceError: openWindow is not defined
And when I inspect the HTML I noticed it added a call to window.ModernForm inside the onClick attribute:
<a onclick="window.ModernForm.handleCustomEvent(event, "openWindow()")" target="_blank">Function</a>
How do I make this call to my JavaScript within this handleCustomEvent function call that Laserfiche adds?