![]() |
deleting a row using checkbox - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: deleting a row using checkbox (/showthread.php?tid=27006) |
deleting a row using checkbox - El Forum - 01-29-2010 [eluser]sasori[/eluser] hi, can you guys help me develope the logic for this? yes i mean code snippets here's my controller code Code: public function members_area() here's my model code Code: public function get_urls() here's my view code Code: <table> here's the initial look Code: http://i47.tinypic.com/24vp81v.jpg if am gonna place a delete link or button at the bottom, how will i make the "checked" box be deleted ? deleting a row using checkbox - El Forum - 01-29-2010 [eluser]saidai jagan[/eluser] name the check box as array ex. Code: <input type=checkbox name=delete[] value=row->id /> Code: print_r($this->input->post(delete)); deleting a row using checkbox - El Forum - 01-29-2010 [eluser]sasori[/eluser] hi, the delete is working now, but i got a new problem all the rows gets deleted even if i checked only 1 box LOL here's my controller code Code: public function delete() here's my new model function Code: public function delete() and here's my view code Code: <?php form_open('site/delete'); ?> deleting a row using checkbox - El Forum - 01-29-2010 [eluser]saidai jagan[/eluser] show the Code: print_r($this->input->post(delete)); deleting a row using checkbox - El Forum - 01-29-2010 [eluser]sasori[/eluser] I added Code: <?php echo print_r($this->input->post('delete')); ?> and it prints "1" deleting a row using checkbox - El Forum - 01-29-2010 [eluser]Rob Gordijn[/eluser] try Code: <?php echo print_r($this->input->post('delete'),1); ?> deleting a row using checkbox - El Forum - 01-29-2010 [eluser]sasori[/eluser] [quote author="Rob Gordijn" date="1264784921"]try Code: <?php echo print_r($this->input->post('delete'),1); ?> i think you mean Code: echo print_r($this->input->post('delete',1)); the output is the same, it prints 1 deleting a row using checkbox - El Forum - 02-20-2010 [eluser]radomir_radojevic[/eluser] Hi ninja ![]() try this model function: Code: public function delete() deleting a row using checkbox - El Forum - 02-20-2010 [eluser]sasori[/eluser] thanks for the reply Mr. radomir, I guess you're a real ninja in PHP haha. deleting a row using checkbox - El Forum - 02-12-2011 [eluser]zend[/eluser] This to me does not work ... I use the whole code here but the theme will not work ... Not deleted |