ivan77 Posted November 8 Report Share Posted November 8 Hi, I have field Period on submission form, before submit I want to check the submission base table for those field. If period : 11-2024 already exist on table for specific email id, I want to show notification and disable / prevent submit Is it possible to do this and how ? Rgds, Quote Link to comment Share on other sites More sharing options...
0 CoopperBackpack Posted November 8 Report Share Posted November 8 Hello @ivan77, This post can be helpful: 1) The idea is to add a hidden Virtual field to check the condition using the SELECT statement. For example (field names and table name should be replaced with the corresponding names): CASE WHEN EXISTS (SELECT ID FROM Table_Name WHERE Email = [@field:Email] AND Period = [@field:Period]) THEN 1 ELSE 0 END Is the Email field received from Authentication? 2) Add the code to the Footer section: <script> document.addEventListener('BeforeFormSubmit', function(event) { let virtualField = document.querySelector("input[id*='cbParamVirtual1']").value; // use the corresponding number of the Virtual field if (virtualField === '1') { event.preventDefault(); alert('This period exsists, choose another one'); } }) </script> Or this version with custom notifications: <script src="//cdn.jsdelivr.net/npm/sweetalert2@11"></script> <script> document.addEventListener('BeforeFormSubmit', function(event) { let virtualField= document.querySelector("input[id*='cbParamVirtual1']").value; if (virtualField === '1') { event.preventDefault(); Swal.fire( '', 'This period exsists, choose another one', 'error' ); } }) </script> If this doesn`t work, please provide more details. ivan77 1 Quote Link to comment Share on other sites More sharing options...
0 ivan77 Posted November 11 Author Report Share Posted November 11 Yes it Works, Thanks @CoopperBackpack CoopperBackpack 1 Quote Link to comment Share on other sites More sharing options...
Question
ivan77
Hi,
I have field Period on submission form, before submit I want to check the submission base table for those field.
If period : 11-2024 already exist on table for specific email id, I want to show notification and disable / prevent submit
Is it possible to do this and how ?
Rgds,
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.