Vitalikssssss Posted August 25, 2017 Report Share Posted August 25, 2017 Hi there, I would like to share a JS solution which I have used for my project. This script that can be used to clear fields in the bulk edit screen. The bulk edit screen typically displays the data from the last update, and my JS allows not show the previous content of fields. Place following JS into the Footer of Bulk edit screen. Make sure that you have disabled HTML editor. <script type="text/javascript"> var aaa= document.getElementById("BulkUpdateFormBody"); var v_li = aaa.getElementsByTagName("input"); var v_ls = aaa.getElementsByTagName("select"); var v_lt = aaa.getElementsByTagName("textarea"); var f_tmpf = function(v_list, v_resList){ var v_res = v_resList || []; var v_length = v_list.length; for(var v_i = 0; v_i < v_length; v_i++) if((v_list[v_i].type || "").toUpperCase()!="HIDDEN" && (v_list[v_i].nodeName||'').search(/input|select|textarea/ig) != -1) v_res.push(v_list[v_i]); v_resList = v_res; return v_res; } var v_cleanI=f_tmpf(v_lt, f_tmpf(v_ls, f_tmpf(v_li, []))); v_cleanI.forEach(function(v_i){ v_i.value = ""; }); </script> I hope this will be useful for someone. Quote Link to comment Share on other sites More sharing options...
Rmorr Posted August 29, 2017 Report Share Posted August 29, 2017 Thank you for posting this helpful JS solution! This is exactly what I am needing for one of our projects. The only problem I'm experiencing is that my bulk edit data is not saving to my table after adding this script to the DataPage. Any ideas what I might be doing wrong? I used the script as is - no changes. Quote Link to comment Share on other sites More sharing options...
Vitalikssssss Posted August 30, 2017 Author Report Share Posted August 30, 2017 Hi Rmorr, Thank you for your feedback. I`ve applied few changes to my initial solution which should resolve the issue. <script type="text/javascript"> var aaa= document.getElementById("BulkUpdateFormBody"); var v_li = aaa.getElementsByTagName("input"); var v_ls = aaa.getElementsByTagName("select"); var v_lt = aaa.getElementsByTagName("textarea"); var f_tmpf = function(v_list, v_resList){ var v_res = v_resList || []; var v_length = v_list.length; for(var v_i = 0; v_i < v_length; v_i++) if((v_list[v_i].type || "").search(/HIDDEN|button|image/ig)==-1 && (v_list[v_i].nodeName||'').search(/input|select|textarea/ig) != -1) v_res.push(v_list[v_i]); return v_res; } var v_cleanI=f_tmpf(v_lt, f_tmpf(v_ls, f_tmpf(v_li, []))); v_cleanI.forEach(function(v_i){ v_i.type == "checkbox" ? v_i.checked = false : v_i.value = ""; }); </script> Hope this helps. Quote Link to comment Share on other sites More sharing options...
Rmorr Posted August 30, 2017 Report Share Posted August 30, 2017 Thanks so much! This did the trick. My updates are now saving again to the table. Appreciate your help!! 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.