I'm new to Jquery. Didn't have time yet to sit and read about it. Just read 1-2 articles and I realized it is more or less like a PHP, so I am trying to get some stuff work with Jquery.
I don't know if I should mention that I am currently using Jquery Tools library.
What I am trying to do is;
1. When I click delete link, Jquery will get the id of the a element.
2. Opens a modal box, replace "yes" link's href to confirm and delete the data.
I have everything working except 1 fatal problem.
Here is my list;
ID - TITLE - DELETE
5 - Test 5 - delete
4 - Test 4 - delete
3 - Test 3 - delete
2 - Test 2 - delete
1 - Test 1 - delete
When I click ID number 1, it is opening modal box and asking for confirmation. Everything works just fine as long as I will not click "no" and close the modal box and try to delete another one.
var formUrl = "includes/ajax/forms.php?do=delete_news&id=";
deleteUrl = formUrl + this.id
// Add delete link to confirmation button
If I click on ID 1, the link is includes/ajax/forms.php?do=delete_news&id=1
Problem is, if I click no and later try to delete ID 2, it is still showing the same URL (includes/ajax/forms.php?do=delete_news&id=1)
Whichever ID, I will click first, if I will click no and try to delete another one, the first clicked element's ID is staying as permanent.
I will be glad if anyone could help me out with it.