I have a dialog confirmation that must be reused for several controls in a html page.
Each change in a select, fire this dialog.
This is my code:
console.info("before:" + select[0].id);
dialog = $('#dialogReject').dialog(
{
autoOpen:false,
height:300,
width:400,
modal:true,
buttons:
{ "Ok":
function() {
console.info("after:" + select[0].id);
},
}
});
dialog.dialog('open');
So, I have 2 selects. I change the first, show the dialog. The id
in before
& after
are equal.
I select the second, change it and show the dialog. Now in before
the correct id
is displayed but in after
is the id
of the first select.
How avoid this?