DesiLogi Posted July 18, 2022 Report Share Posted July 18, 2022 Hi, the below code is to disable and relabel the Update button in Bulk Edit when it is clicked (it's a datapage with a lot of records and takes several seconds to update so the user needs to know what's happening and not click the Update button more than once). This code is in the footer of the Results page and not the Bulk Edit form. I need to add the additional code (see below) that redirects to another webpage and I can't figure out where/how to insert it into the disable/relabel code. Does anyone know how to do this? Here's the disable/relabel code for the Update button in Bulk Edit: <script> document.addEventListener('DataPageReady', function (event) { const target = document.querySelector('body'); const observer = new MutationObserver(mutations => { const updateBtn = document.querySelector('input[value="Update"]'); if(updateBtn){ updateBtn.addEventListener('click',function(){ disable(this); redirectToDP(this); }); } }); const config = {subtree:true, childList:true}; observer.observe(target, config); function disable(btn){ btn.disabled = true; btn.style.background="grey"; btn.value = 'Please Wait'; btn.removeEventListener('click',disable); } }); </script> Here's the code in the Bulk Edit footer for redirecting (I think it needs to be there because I have to get parameters from the Bulk Edit data fields): <script> function redirectToDP() { var v_proposal = document.getElementById("BulkEditItems_Triggers_CopyProposalID").value; var v_project = document.getElementById("BulkEditItems_Triggers_CopyProjectID").value; var url = "../proposal?ProposalID=" + v_proposal + "&ProjectID=" + v_project + "&pti=p"; location.replace(url); } </script> I tried to call the function 'redirectToDP' from the disable/relabel code but it doesn't work. Does anyone know how to get the redirect code to work with the disable/relabel code? Many thanks! Quote Link to comment Share on other sites More sharing options...
futurist Posted June 20, 2023 Report Share Posted June 20, 2023 Hi, sharing this bulk edit feature I came up with that you might find useful: 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.