I cannot reveal all source code, but I'll list what is doing the stuff only. I have two pages setup. PAGE1 is the main page and PAGE2 is the page with the form for the UI Dialog. PAGE1 is causing the trouble.
PAGE1:
----------
<table id="myform" cellpadding="0" cellspacing="0" align="center">
<tr>
<td><table id="myformfields" width="100%"></table></td>
</tr>
</table>
<script type="text/javascript">
$(document).ready(function(){
$('#myform').dialog({ autoOpen: false, resizable: false, show: 'slide', minWidth: 600,
open: function(e,u) {
alert('x'); // Here is the ALERT
$("#s_txt").autocomplete({
minChars: 2,
source: [{label: "abcd", value: "You picked ABCD"}, {label: "aceg", value: "This is ACEG"}],
select: function(e,u) {
$("#s_txt").val(u.item.value);
return false;
}
});
},
close: function(e,u) {
$('#s_txt').autocomplete("close");
$('#'+zzID).removeClass('clicked');
},
buttons: {
'Remove': function() {
$(this).dialog('close');
$('#'+zzID).removeClass('clicked');
$.ajax({
type: 'POST',
url: 'page2.lasso',
data: { r:2, i:zzID, ut:$.trim($('#s_ut').val()) },
complete: function(xhr, textStatus) { upd($.trim(xhr.responseText)); }
});
},
'Save': function() {
$(this).dialog('close');
$('#'+zzID).removeClass('clicked');
$.ajax({
type: 'POST',
url: 'page2.lasso',
data: { r:3, i:zzID, t:$.trim($('#s_txt').val()) },
complete: function(xhr, textStatus) { upd($.trim(xhr.responseText)); }
});
}
}
});
$('.somedomobj').click(function(e) {
if (zzID != '') $('#'+zzID).removeClass('clicked');
zzID = $(this).attr('id');
$('#'+zzID).addClass('clicked');
$.ajax({
type: 'POST',
url: 'page2.lasso',
data: { r:1, i:zzID },
complete: function(xhr, textStatus) { $('#myformfields').html(xhr.responseText); }
});
$('#myform').dialog('option', 'title', "Test autocomplete in UI Dialog").dialog('option', 'position', ["[e.clientX+10,e.clientY+10]"]).dialog('open');
});
});