Ronan Posted December 10, 2018 Report Share Posted December 10, 2018 Hi, I have a search DataPage and when I bulk edit my records. I want to be automatically focus on the first text box of my bulk edit window <script type="text/javascript"> document.addEventListener('DataPageReady', function (event) { document.getElementById("element_ID").focus(); }); </script> I have the code above, but it is not working please help. Quote Link to comment Share on other sites More sharing options...
DefinitelyNot31337 Posted December 11, 2018 Report Share Posted December 11, 2018 Hello @Eruel, I have developed a solution that does that. Paste the script below in the footer of "Configure Fields for Bulk Edit Section", then update elemId to the name of your table field. <script> var elemId = "gist"; setTimeout(function(){ document.querySelector(`[action*="[@cbAppKey]"] [id^=BulkEdit${elemId}]`).focus(); }, 300) </script> You might be asking why I put the code in a synchronous function setTimout. This is because there is a Caspio function that overrides the element focus after the BulkEditForm. I can't pinpoint where so I just did the setTimeout hack. Hope this helps. Cheers, DN31337 Quote Link to comment Share on other sites More sharing options...
Ronan Posted December 11, 2018 Author Report Share Posted December 11, 2018 Thank you @DefinitelyNot3133, Your solution work splendidly, have a great day! DefinitelyNot31337 1 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.