views:

25

answers:

1

I use next function to build Modal box. And I need jquery combo box inside that modal box.

      function launchModal(id) {
        jQuery('body').append('<div id="catmodal" title=""><select id="ac_s1"><option value="Home Security"></option></select></div>');
        jQuery('#'+id).dialog({
          resizable: false,
          height: 370,
          width: 900,
          modal: true,
          buttons: {Close: function(){jQuery(this).dialog('close');}},
          close: function(event, ui){jQuery(this).dialog('destroy').remove();}
        });

And I wrote

jQuery(document).ready(function(){ jQuery("#ac_s1").combobox(); }

But it works only outside modal box function, if I insert inside of modal box function content, it stops working and simple html Select menu appears.

How to solve it???

A: 

give an id to modal div - modaldiv

write html in that

try $('#modaldiv').html(.......) or $('#modaldiv').text(.......)

zod