Unable to use joget.submitForm(). It is throwing error.
I want to stop the navigation of a form after form submit. For this I am trying to write a script in customHTML.
So for this I am trying to do the form submission manually by using the following code :
<script type="text/javascript">
document.addEventListener("DOMContentLoaded", function(event) {
var submitButton = document.querySelector("[type='submit']");
if (submitButton) {
submitButton.addEventListener("click", function(event) {
event.preventDefault();
// Add custom logic here
// ...
// Submit the form manually when ready
joget.submitForm();
// Prevent form navigation
event.stopPropagation();
});
}
});
</script>
This is giving me error that joget is not defined. Also If I try to include joget.js and joget.min.js file (which should be automatically included) by API, I am getting error as it is unable to find these two files :
/jw/web/js/joget.js
Please help. Thanks in Advance