I didn't realize there was a setter option for that, cool now I can change my code LOL
Mean Mike On Jul 16, 9:55 am, Charlie <charlie...@gmail.com> wrote: > dialog has a setter option for title, it isn't really a title attiribute. The > dialog "title is actually a span with class > ui-dialog-title-dialoghttp://jqueryui.com/demos/dialog/#option-title$('.selector').dialog('option', > 'title', 'Dialog Title');either pass the id into the option or you can > use$(".button").click(function(event){ > > $('#dialog').dialog('open'); > $('.ui-dialog-title-dialog').text($(this).attr("id")); > }); > constructor must be separate as Mike pointed out > Mean Mike wrote:Yes that is correct you need to separate the dialog from the > open like this note: I set the autoOpen to false. [code] > $(document).ready(function(){ $(".button").click(function(event){ > $("#dialog").attr("title", event.target.id); $('#dialog').dialog('open'); }); > $("#dialog").dialog({ autoOpen:false, modal:true, overlay: {backgroundColor: > "#000",opacity: 0.5}, resizable:false, buttons:{ "Delete": function() {}, > "Cancel": function() {$(this).dialog("close");} } }); }); [/code] let me know > how that works out for you Mean Mike On Jul 16, 8:31 am, Carlo > Landmeter<clandme...@gmail.com>wrote:Hi, I have probably a simple question > which i cannot seem to find the answer to. I have a series of images which i > want to use as buttons to trigger a dialog. Inside this dialog i need the ID > of the image button (or any other element). But it seems after I load the > dialog i cannot alter the content of it anymore. As an example I have tried > to change the title of the #dialog so it will show the updated title when i > click the button. The only way i am able to do this is when i put all of this > inside the .click function and start with .attr function followed by the > .dialog function. The problem is when i do this and close the dialog i cannot > enable the dialog anymore. I guess this is why they have the .dialog("open"). > Is there a way i can achieve what I'm trying to do here? Maybe there is a > better way of doing this? Tia, Carlo code: $(document).ready(function(){ > $(".button").click(function(event){ $("#dialog").attr("title", > event.target.id); $("#dialog").dialog({ autoOpen:true, > modal:true, overlay: {backgroundColor: "#000",opacity: 0.5}, > resizable:false, buttons:{ "Delete": function() {}, > "Cancel": function() {$(this).dialog("close");} } }); }); }); > <div id="dialog" title="i did not change">this is a test</div>