there is something weird happening on my webpage.
I want to add a confirmation jquery dialog when I click a button. The problem is....I have that button multiple times on my page, each one having its "id" and is created by php (so there can be 2,3,4,5 buttons on a page).
The button looks like this:
<a href="#" id="confirm" onclick="addlist(<?php echo $v['id'];?>);return false;"><img src="img/item_add.png" alt="add" width="100" height="46" /></a>
And this is my jquery
$(document).ready( function(){
$('#dialog').dialog({
autoOpen: false,
width: 600,
buttons: {
"Ok": function() {
$(this).dialog("close");
},
}
});
$('#confirm').click(function() {
$('#dialog').dialog('open');
return false;
});
});
The problem is that, my jquery code is working just fine, but only for the first button, the second, third...etc not
you have here my example: http://jsfiddle.net/S4vSU/1/
I want to have that dialog working for every button. Where is the problem ?
Thank you in advance !