JhtmlArea Dialog fails re-open on multiple click event of button.

May 21, 2012 at 10:49 AM
Edited May 21, 2012 at 10:51 AM

Script call:

function Showdialog(id) {

glboalid = id; $("#dialog").dialog({ width: 420 }); //$("#dialog").parent().appendTo($("form:first")) $("#dialog").load(); $("#dialogEditor").html(''); $("#dialogEditor").htmlarea('pasteHTML', $(id).html()); $("#dialog").dialog("open");

}

function CloseDialog(id) {

$(glboalid).html($('#dialogEditor').htmlarea('toHtmlString')) $("#dialogEditor").htmlarea("dispose"); $("#dialog").dialog("close");

}

 

HTml source

<textarea id="dialogEditor" style="width: 400px;" rows="10">some test</textarea> <input onclick="CloseDialog('dialog')" type="button" value="Close" /><input onclick="CloseDialog('dialog')" type="button" value="Save" />
Please help me out..