jQuery UI dialog in form

jQuery UI dialog in form

I have created a modal dialog inside a form.  The intent is to display some optional fields if the user clicks an "options" button.

I found that when autoOpen is false, the trigger button allows the dialog to flash, but immediately close.  It works ok with autoOpen true, with the exception that the dialog is opened immediately.  If I remove the <form></form> tags, the dialog works properly, but of course it is no longer a form.

Is there a way to use a dialog inside a form in this manner?