function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Jason DunphyJason Dunphy 

How to invoke jquery dialog on a standard page at pageload (with no button or onclick action needed)

Is it possible to invoke a jquery dialog on a standard page (case is what I'm trying for) without using a onclick javascript button?  Ideally I'd like the dialog to appear on pageload based on a field value being met (i.e. fielda = true).  Similar to what you can do with a javascript alert on a standard page, but I want more flexibility with what I can present in window the popups (a window title and a ref link instead of just "an embeded page says" with text only).

Below is what would work using the button approach (that is well documented), but I'm looking to convert this so that it happens at pageload when certain critiera on the page is met.  Any ideas for making this happen, is it even possible on a standard page?

Thanks
{!REQUIRESCRIPT("//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js")}
{!REQUIRESCRIPT("//ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js")}

var j$ = jQuery.noConflict();

var iframe_url = '{!URLFOR("/apex/testmodal")}';
var j$modalDialog = j$('<div></div>')
       .html('<iframe id="iframeContentId" src="' + iframe_url + '" frameborder="0" height="100%" width="100%" marginheight="0" marginwidth="0" scrolling="no" />')
       .dialog({
            autoOpen: true,
            title: 'Test Dialog',
            resizable: false,
            width: 400,
            height: 400,
            autoResize: true,
            modal: true,
            draggable: false
});

j$modalDialog.dialog('open');