Welcome Guest, Not a member yet? Register   Sign In
Showing some Javascript on delete
#1

[eluser]the_unforgiven[/eluser]
Hi All,

I some code in my model then when a link is clicked to delete it deletes the listing from the database.

But I want a javascript pop up to say something like "Are you sure you want to delete" and then if they press ok it deletes or no to not delete.

Code:
//This is in my controller:

function deleteclient()
{
  $this->client_model->delete_client();
}
Code:
//This is the delete_client method in the model
function delete_client()
{
  $this->db->where('id', $this->uri->segment(3));
  $this->db->delete('tblClients');
  $data['title'] = "Delete Client";
  $data['success'] = $this->session->set_flashdata('success', 'The client has been successfully deleted');
  
  $this->load->view('delclient', $data);
}

And heres some javascript i have for something else and want to use the same functionality.
Code:
[removed]
      alert("Sorry you MUST be logged in to view this page, please login!");
      location = "../users";
  [removed]




Theme © iAndrew 2016 - Forum software by © MyBB