I have the following MySQL for a delete button.
DELETE FROM mytable
WHERE id = $id
I want to add a jquery modal to confirm to proceed. "Are you sure to delete? Yess | No"
If you click YES then it will execute to delete, if it is NO then exit the modal and go back to the page.
--Updated--
The id in each ancho is added dynamically.
echo anchor('admin/categories/delete/'.$list['id'],'delete',array('class' => 'modalInput'));
This output the following html.
HTML ... 1 Forsiden
<td align='center'>active</td>
<td align='center'><a href="http://127.0.0.1/test/index.php/admin/categories/edit/1">edit</a> | <a href="http://127.0.0.1/test/index.php/admin/categories/delete/1">delete</a></td>
</tr>
<tr valign='top'>
<td>2</td>
<td>Front top</td>
<td align='center'>active</td>
<td align='center'><a href="http://127.0.0.1/test/index.php/admin/categories/edit/2">edit</a> | <a href="http://127.0.0.1/test/index.php/admin/categories/delete/2">delete</a></td>
</tr>
...
...
Could anyone teach me what the best way is.