UI Dialog Problem, instance issues
I have a html table, when the user click one of the cells it opens a dialog, and perform some actions using a form inside this dialog, but when I click again on another cell it seems that it creates a new dialog and a new form so now i have two dialogs with the same id and 2 forms and such..,
so my questojs is: if im calling the same dialog $(myDiv").dialog('open') on every cell click, why it creates a new one and the form doesn't work anymore?.
Here's the code:
//-------------------------------------------------------------------
$('#tbodyArtReportadosListado tr:not(:last)').find('td').livequery('click',function(){
var idTr = $(this).parents('tr').attr('id'); //Every row has it's own id
nombreInsumo = $(this).parents('tr').find('td:eq(1)').text(); //I need the text from the second cell of the row
$('#hdnIdArticuloReportado').val(idTr);
$('#txtNombreProducto').val(nombreInsumo);
$('#divCrearArticulo').dialog('open');
return false;
});
//-------------------------------------------------------------------