Jump to content

Data not submitting to table on execution


Recommended Posts

Hi - I have a data page where I've set up a filter by class so users can tab through different sections. Because the filters use buttons I use the following JS to stop the page from executing until the user has finished. When they're done, they click a virtual field to activate the submit button. In my original app, this works fine. The datapage type was different though - in every example I used the "details" page. I'm currently designing this in the  tabular, then details page. The form appears to submit, but it actually doesn't enter any data into the table, and even when I ask to show a message, submit just returns back to the results page.  My guess is the different datapage type is behind this issue but I have no idea how I can fix it (or if I can fix it...) Any help would be appreciated. Thanks


document.addEventListener('BeforeFormSubmit', function () {
event.preventDefault();

if (document.getElementById("cbParamVirtual1").checked) {
document.forms["caspioform"].submit();
}

else {
event.preventDefault();
}

});

 

Link to comment
Share on other sites

Ok - so after more experimenting today,  this is more likely a datapage issue and not JS, or its a local issue with my app.

I can get my code to work with single record update - and it will update the right view. I can get my code to work if I change it to just update the table (not the view). I just can't get this code to update my table through the view via the table details page. And yes the view is set to update the right table, which is why it works on the single record update. (I've checked this and also recreated the view - as well as the pages).  

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 weeks later...

I'm back with this problem again. And this time it's not as simple as switching datapage type from table >details page to an Update Record type. @PotatoMato - the form will only update the datatable when the JS is removed. If the JS is read, then the form appears to submit, but the page returns to the table data results. I updated to give a successful data submission message, and when the JS is used, this doesn't appear on submit.  I know when we're referencing a view in a calc field sql we use _v_ to refer to the table and I'm wondering if there's something unique that needs to be added in the details form submission when the data originates from a view... Any ideas / suggestions would be greatly appreciated. I've also posted this in JS in case you've seen this issue posted there.  

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...