dear friends, I have one input field, when I write some letter and press enter then ajax request will happen. Return value from ajax I append to one tag div. Then I load data into dialog. I can do that, but the problem is It just happens one time and the problem when data successfully load, the close button of the dialog doesn't work fine. Do I have something wrong??
this is my example code : $("#dialog").dialog({ bgiframe: true, autoOpen: false, height: 900, width:800, modal: true, buttons: { 'Tutup': function() { $(this).dialog('close'); }, 'Simpan' : function() { $('form#saveform').submit(); } } }); $('.textfield').keypress(function(event){ if (event.which == 13) { var z = $(this).attr('id'); var nilai = $('#'+z).val(); $('#nick').val(nilai); $('#fpersonform').submit(); } }); $('#personform').submit(function() { $.ajax({ type : "POST", url : some_url, data : 'name=' + $('#nick').val(), success : function(data) { $('#dialog').dialog('open'); $('#dialog').html(data); } }) return false; });