Error messages appear in background page, not in dialog I have a form being displayed in a jQuery modal dialog. When the form is filled out incorrectly (ie a required field left blank) the error messages appear in the background page, not in the dialog overlay. This is not the beaviour I want and is confusing for users. How do I get drupal status messages to appear in the dialog box?

I am using Drupal 7 with jQuery 1.5.

Thanks.
To help those implement @Clive's suggestion you can do the following:

(function ($) {
  $(document).ready(function () {
    $("#dialog").dialog({
        autoOpen: false,
        modal: true,
        width: 400,
        open: function() {
            $('.messages').prependTo('#dialog');
        }
    });
  });
})(jQuery);


Substitute #dialog with the name of the div containing your dialog's components.