$(document).ready(function(){
$('#1, #2').click(function(){
window.clickedbtnid = $(this).attr('id');
$( "#table_dialog_1" ).dialog();
});
$( "#table_dialog_1" ).find('td').click(function(){ $('#'+window.clickedbtnid).parent().prev().find('input').val($(this).id);
$( "#table_dialog_1" ).dialog('close');
})
});
$('#input_'+id).attr('value', $(this).html());
this was closed to what i want but it only pass based on clicked td's
text of table on dialog area because what I need is the first td
table of dialog window to pass on input tag
, and second td
and third
on link tag element
. See my last table in fiddle below, it should look like the table on the main page when dialog window is closed.
see this FIDDLE