CodeIgniter Forums
check all with checkbox - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: check all with checkbox (/showthread.php?tid=53724)



check all with checkbox - El Forum - 08-06-2012

[eluser]iaa ioo[/eluser]
$new_order = ($order_type == 'asc' ? 'desc' : 'asc');$this->table->set_heading(
form_checkbox(),
'No',
anchor('awal/kami/'.$offset.'/nama_panggilan/'.$new_order, 'Nama'),
anchor('awal/kami/'.$offset.'/jk/'.$new_order, 'JK'),
anchor('awal/kami/'.$offset.'/alamat/'.$new_order, 'Alamat'),
anchor('awal/kami/'.$offset.'/no_hape/'.$new_order, 'No HP'),
'Pilihan'
);
$i = 0 + $offset;
foreach ($saudara2 as $saudara){
$this->table->add_row(form_checkbox('check[]', $saudara->identitas_id),
++$i,
$saudara->nama_panggilan,
$saudara->jk,
$saudara->alamat,
$saudara->no_hape,
anchor('awal/view/'.$saudara->identitas_id,'Detil',array('class'=>'view')).' '.
anchor('awal/update/'.$saudara->identitas_id,'Ubah',array('class'=>'update')).' '.
anchor('awal/delete/'.$saudara->identitas_id,'Hapus',array('class'=>'delete','onclick'=>"return confirm('Apakah anda yakin ingin menghapus data?')"))
);
}


dear master,,please help to make "check all" in this script..Smile


check all with checkbox - El Forum - 08-06-2012

[eluser]Aken[/eluser]
You need to do it with Javascript. Do a Google search for "select all checkboxes" or something along those lines.


check all with checkbox - El Forum - 08-06-2012

[eluser]iaa ioo[/eluser]
ok,,mr. aken,,thanks for the reply,,,i will try it..


check all with checkbox - El Forum - 08-08-2012

[eluser]iaa ioo[/eluser]
sorry mr. aken,,,i have already try with jquery,,but it still not work,,,can you please help me...my scrip look like this :

[removed]
<!--

<!-- Begin
function Check(chk)
{
if(document.myform.Check_ctr.checked==true){
for (i = 0; i < chk.length; i++)
chk[i].checked = true ;
}else{

for (i = 0; i < chk.length; i++)
chk[i].checked = false ;
}
}

// End --&gt;
[removed]

$js =
form_checkbox('check', 'cek', TRUE, $js) <--check all

form_checkbox('check_list', $saudara->identitas_id) <--check from table