I'm using the script below in an html block to make a submission datapage autosubmit.
However, my webpage has two other static datapages on it, with the submit buttons hidden. When this autosubmit code runs, it submits one of the other datapages too. Is there a way to make it only submit the particular submission form that it's attached to, e.g. by specifying the app key?
If it's relevant, this submission box is in a modal that appears on top of a tabular datapage.
You can post now and register later.
If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.
Question
oliverk
Hello
I'm using the script below in an html block to make a submission datapage autosubmit.
However, my webpage has two other static datapages on it, with the submit buttons hidden. When this autosubmit code runs, it submits one of the other datapages too. Is there a way to make it only submit the particular submission form that it's attached to, e.g. by specifying the app key?
If it's relevant, this submission box is in a modal that appears on top of a tabular datapage.
Thanks!
<script type="text/javascript">
document.addEventListener('DataPageReady', function (event) {
const error = document.querySelector('div[data-cb-name="HeaderErrorMsg"]');
if(!error){
if(document.getElementById("caspioform")) {
document.getElementById("caspioform").style.display = 'none';
setTimeout('document.forms["caspioform"].submit()',1000); }
}
});
</script>
Link to comment
Share on other sites
2 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.