how can i do it?
please help me.
thanks.Delete record from datagrid with ajax use checkboxes.?
this is a regular html with a javascript function, you can implement it to AJAX later if you want to.
%26lt;!DOCTYPE html PUBLIC ';-//W3C//DTD HTML 4.01 Transitional//EN';%26gt;
%26lt;html%26gt;
%26lt;head%26gt;
%26lt;title%26gt;
SOCCER Field
%26lt;/title%26gt;
%26lt;script language=';Javascript'; type=';text/javascript';%26gt;
function deleteItem() {
var e = document.getElementsByName(';checkID';);
var message = 'delete all selection??';
var row_list = {length: 0};
for (var i = 0; i %26lt; e.length; i++) {
var c_box = e[i];
if (c_box.checked == true) {
row_list.length++;
row_list[i] = {};
row_list[i].row = c_box.parentNode.parentNode;
row_list[i].tb = row_list[i].row.parentNode;
}
}
if (row_list.length %26gt; 0 %26amp;%26amp; window.confirm(message)) {
for (i in row_list) {
if (i == 'length') {
continue;
}
var r = row_list[i];
r.tb.removeChild(r.row);
}
}
}
%26lt;/script%26gt;
%26lt;/head%26gt;
%26lt;body%26gt;
%26lt;form name=';myform'; id=';myform';%26gt;
%26lt;input onclick=';deleteItem()'; type=';button'; value=';Delete';%26gt;%26lt;br%26gt;
%26lt;table id=';myTable'; border=';1';%26gt;
%26lt;tbody%26gt;
%26lt;tr id=';d1';%26gt;
%26lt;td%26gt;
%26lt;input name=';checkID'; type=';checkbox';%26gt;01
%26lt;/td%26gt;
%26lt;td%26gt;
satu
%26lt;/td%26gt;
%26lt;/tr%26gt;
%26lt;tr id=';d2';%26gt;
%26lt;td%26gt;
%26lt;input name=';checkID'; type=';checkbox';%26gt;02
%26lt;/td%26gt;
%26lt;td%26gt;
dua
%26lt;/td%26gt;
%26lt;/tr%26gt;
%26lt;tr id=';d3';%26gt;
%26lt;td%26gt;
%26lt;input name=';checkID'; type=';checkbox';%26gt;03
%26lt;/td%26gt;
%26lt;td%26gt;
tiga
%26lt;/td%26gt;
%26lt;/tr%26gt;
%26lt;tr id=';d4';%26gt;
%26lt;td%26gt;
%26lt;input name=';checkID'; type=';checkbox';%26gt;04
%26lt;/td%26gt;
%26lt;td%26gt;
empat
%26lt;/td%26gt;
%26lt;/tr%26gt;
%26lt;/tbody%26gt;
%26lt;/table%26gt;
%26lt;/form%26gt;
%26lt;/body%26gt;
%26lt;/html%26gt;
No comments:
Post a Comment