You need to hide it in CSS first, for example:
#dialog-form { display: none; }
Opening a dialog box will lead to its display ... this is what the authors of the dialog widget are waiting for :)
Alternatively, hide the div containing all forms ... no matter what you want to hide only display:none on this shell, the dialog will capture and show this or something in it and show it accordingly (just don't use make display for each child, just a wrapper), for example:
<div style="display: none;"> <div id="dialog-form">fields here</div> <div id="dialog-form2">fields here</div> </div>
Or simply:
<div id="dialog-form" style="display: none;"> fields here </div>
source share