NikkiC Posted May 25, 2017 Report Share Posted May 25, 2017 Hi there, I have 2 tables that I'm passing parameters between using a redirect and auto-submit. In the datapage, the user can assign a star rating which is updated in the main table. I wish to pass that parameter to my second table (via the redirect / auto-submit) ONLY if it has changed ... At the moment, the field is called "QA_Tester_Rating" in both tables and it is passing fine from the redirect etc to the 2nd table. Do I want to set up a script in my first datapage or second, to look for changes in the field and only pass the figure if it has changed? I want the field to be blank in my table if there are no changes. Any help much appreciated! Nikki Quote Link to comment Share on other sites More sharing options...
MayMusic Posted July 3, 2017 Report Share Posted July 3, 2017 Is the first page details page? If yes you can add a calculated field to read the value of the rating and see if the new one is different. If not, in the second page receive the parameter in a variable first and also create another variable to compare these two values. If it if not the same then save the new one. <script> var current = document.getElementById('QA_Tester_Rating').value; var newvalue = '[@parametername]'; if ( current != newvalue){ document.getElementById('QA_Tester_Rating').value = newvalue; f_Submit (); } else { f_Submit (); } function f_Submit (){ setTimeout('document.forms["caspioform"].submit()',1000); } </script> Quote Link to comment Share on other sites More sharing options...
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.