I want to delete something from my DB when the delete button is clicked.
So far I have a link to delete information from my DB, but I want to display a button instead of a link.
I don’t understand how to implement a submit button in the following code.
<p>
<?php echo anchor('del_controller/del/'. $id, 'Delete', array('onClick' => "return confirm('Are you sure you want to delete?')"));?>
</p>
You want to use the form_submit()-function instead:
As read in the documentation:
So, getting the result you want you would probably have to write:
The path to POST the form to is set when opening the form.
Read more at http://codeigniter.com/user_guide/helpers/form_helper.html