- <script type="Text/javascript" >
- function Seltall () {
- var chckboxsign = document.getElementById ("ckb"); //ckb Select Box ID for all selected/reversed selection
- var chckbox = document.getelementsbyname ("Chckbox"); //All selection boxes It's all chckbox.
- var num = chckbox.length;
- if (chckboxsign.checked) {
- For (var index =0; index<num; index++) {
- chckbox[index].checked = true;
- }
- }else{
- For (var index =0; index<num; index++) {
- chckbox[index].checked = false;
- }
- }
- }
- function Deleseltedrecords () {
- var chckbox = document.getelementsbyname ("Chckbox");
- var num = chckbox.length;
- var ids = "";
- For (var index =0; index<num; index++) {
- if (chckbox[index].checked) {
- ids + = Chckbox[index].value + ",";
- }
- }
- if (ids!="") {
- if (window.confirm ("OK" to delete the selected record? ")){
- $.ajax ({
- Type: "POST",
- URL: '.. /g3/history-no!batchdelete.action?ids= ' + IDs, //action to be deleted by itself
- DataType: ' json ',
- Success: function (data) {
- Alert ("Delete succeeded");
- Window.location.href = "Channel-no.action";
- },
- Error: function (data) {
- Alert ("System error, delete failed");
- }
- });
- }
- }else{
- Alert ("Please select a record to delete");
- }
- }
- </script>
Batch deletion of JS code