DesiLogi Posted December 23, 2020 Report Share Posted December 23, 2020 Hello, I can't figure out the right syntax for this jquery code to run automatically after submission/update. It runs now (in the datapage footer) when the Submit button is clicked (it opens a FancyBox) but I need it to run after submission by a slight delay. The reason is that on Submit table A runs a trigger that updates table B and the FancyBox (opens another datapage in an iFrame) uses table B. Sometimes the FancyBox opens too fast, before the trigger has updated table B, and so it doesn't show the latest value. I figure if the code that opens the fancybox runs in the Destination after submission it would be enough of a delay for the trigger to run behind the scenes. I just don't know how to change the code so that it runs automatically in the Destination (message) after submission. Here's the current code, it's activated by a submit button with an id="openfb". I need it to run automatically in the Destination, after submission- any help would be great! <script type="text/javascript"> $("#openfb").on('click', function() { var width = 1100; var v_href= "http://127.0.0.1:9090/shortcuts/universal-item-search2?"; parent.$.fancybox.open({ closeBtn:false, openEffect : 'none', closeEffect : 'none', modal:true, type:'iframe', autoSize:true, width:width, href:v_href }); }); </script> Quote Link to comment Share on other sites More sharing options...
DesiLogi Posted December 23, 2020 Author Report Share Posted December 23, 2020 Just figured this out, if anyone needs it. Was simpler than I thought, just remove the button's onclick fucntion lines: <script type="text/javascript"> var width = 1100; var v_href= "http://127.0.0.1:9090/shortcuts/universal-item-search2?"; parent.$.fancybox.open({ closeBtn:false, openEffect : 'none', closeEffect : 'none', modal:true, type:'iframe', autoSize:true, width:width, href:v_href }); </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.