<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://docs.moodle.org/dev/index.php?action=history&amp;feed=atom&amp;title=Javascript_Custom_Modal_Window</id>
	<title>Javascript Custom Modal Window - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://docs.moodle.org/dev/index.php?action=history&amp;feed=atom&amp;title=Javascript_Custom_Modal_Window"/>
	<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Javascript_Custom_Modal_Window&amp;action=history"/>
	<updated>2026-04-20T21:59:36Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.5</generator>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Javascript_Custom_Modal_Window&amp;diff=51412&amp;oldid=prev</id>
		<title>Damyon: Replaced content with &quot;{{obsolete}}  This page has been removed because it contained inaccurate out of date information. To see the original text of this page check the history.&quot;</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Javascript_Custom_Modal_Window&amp;diff=51412&amp;oldid=prev"/>
		<updated>2016-12-02T05:29:19Z</updated>

		<summary type="html">&lt;p&gt;Replaced content with &amp;quot;{{obsolete}}  This page has been removed because it contained inaccurate out of date information. To see the original text of this page check the history.&amp;quot;&lt;/p&gt;
&lt;a href=&quot;https://docs.moodle.org/dev/index.php?title=Javascript_Custom_Modal_Window&amp;amp;diff=51412&amp;amp;oldid=29066&quot;&gt;Show changes&lt;/a&gt;</summary>
		<author><name>Damyon</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Javascript_Custom_Modal_Window&amp;diff=29066&amp;oldid=prev</id>
		<title>Kevinslondon: /* Javascript Custom Modal Window */</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Javascript_Custom_Modal_Window&amp;diff=29066&amp;oldid=prev"/>
		<updated>2011-08-05T16:13:07Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;Javascript Custom Modal Window&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 16:13, 5 August 2011&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l5&quot;&gt;Line 5:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 5:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Sometimes you might to use a custom modal window to do a quick update of a form value to save having to go on to another page. This one allows you to use the TinyMCE editor in a modal popup. Note that the TinyMCE editor seems to be a little buggy in a modal popup so might need further work.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Sometimes you might to use a custom modal window to do a quick update of a form value to save having to go on to another page. This one allows you to use the TinyMCE editor in a modal popup. Note that the TinyMCE editor seems to be a little buggy in a modal popup so might need further work.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This implementation is fully HIJAX compliant, it should with or without JavaScript enabled.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This implementation is fully HIJAX compliant, it should &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;work &lt;/ins&gt;with or without JavaScript enabled.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The view PHP page&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The view PHP page&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Kevinslondon</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Javascript_Custom_Modal_Window&amp;diff=29065&amp;oldid=prev</id>
		<title>Kevinslondon: Created page with &quot;== Javascript Custom Modal Window ==  There are custom popup windows in Moodle and there is M.util.show_confirm_dialog in lib/javascript-static.js if you want to use it.  Sometim...&quot;</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Javascript_Custom_Modal_Window&amp;diff=29065&amp;oldid=prev"/>
		<updated>2011-08-05T16:11:25Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;== Javascript Custom Modal Window ==  There are custom popup windows in Moodle and there is M.util.show_confirm_dialog in lib/javascript-static.js if you want to use it.  Sometim...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Javascript Custom Modal Window ==&lt;br /&gt;
&lt;br /&gt;
There are custom popup windows in Moodle and there is M.util.show_confirm_dialog in lib/javascript-static.js if you want to use it.&lt;br /&gt;
&lt;br /&gt;
Sometimes you might to use a custom modal window to do a quick update of a form value to save having to go on to another page. This one allows you to use the TinyMCE editor in a modal popup. Note that the TinyMCE editor seems to be a little buggy in a modal popup so might need further work.&lt;br /&gt;
&lt;br /&gt;
This implementation is fully HIJAX compliant, it should with or without JavaScript enabled.&lt;br /&gt;
&lt;br /&gt;
The view PHP page&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
//We need the tiny mce lib to get the version&lt;br /&gt;
require_once($CFG-&amp;gt;libdir . &amp;#039;/editor/tinymce/lib.php&amp;#039;);&lt;br /&gt;
&lt;br /&gt;
//YUI 3 at the this time of writing didn&amp;#039;t have modals that actually worked&lt;br /&gt;
$PAGE-&amp;gt;requires-&amp;gt;yui2_lib(&amp;#039;container&amp;#039;);&lt;br /&gt;
&lt;br /&gt;
//Your js file&lt;br /&gt;
$PAGE-&amp;gt;requires-&amp;gt;js(&amp;#039;your_js_file.js&amp;#039;);&lt;br /&gt;
&lt;br /&gt;
//include the tiny mce editor so that the view page can load a form with the editor in it.&lt;br /&gt;
$tiny_mce = new tinymce_texteditor();&lt;br /&gt;
$PAGE-&amp;gt;requires-&amp;gt;js(&amp;#039;/lib/editor/tinymce/tiny_mce/&amp;#039; . $tiny_mce-&amp;gt;version . &amp;#039;/tiny_mce.js&amp;#039;);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
//The link to the custom form you want to show in a modal pop up.&lt;br /&gt;
$your_link = new moodle_url(&amp;#039;/custom_form_handler.php&amp;#039;, &lt;br /&gt;
        array(&amp;#039;id&amp;#039; =&amp;gt; $id), &lt;br /&gt;
        array(&amp;#039;class&amp;#039;=&amp;gt;&amp;#039;pop_up_selector_link&amp;#039;));&lt;br /&gt;
&lt;br /&gt;
//We need an element on the page which will handle the output from the form.&lt;br /&gt;
echo &amp;#039;&amp;lt;p id=&amp;quot;feedback_text&amp;quot;&amp;gt; &amp;lt;/p&amp;gt;&amp;#039;;&lt;br /&gt;
 &lt;br /&gt;
echo html_writer::link($your_link, &amp;#039;Link text&amp;#039;);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The form PHP page.&lt;br /&gt;
&lt;br /&gt;
I haven&amp;#039;t shown the form class, it will be a standard class extending moodleform&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&lt;br /&gt;
//includes&lt;br /&gt;
require(&amp;#039;../../config.php&amp;#039;);&lt;br /&gt;
global $CFG, $USER, $DB;&lt;br /&gt;
require_once($CFG-&amp;gt;libdir . &amp;#039;/adminlib.php&amp;#039;);&lt;br /&gt;
require_once $CFG-&amp;gt;libdir . &amp;#039;/formslib.php&amp;#039;;&lt;br /&gt;
&lt;br /&gt;
//usual $PAGE stuff here ....&lt;br /&gt;
&lt;br /&gt;
require_login();&lt;br /&gt;
&lt;br /&gt;
//Note if the $ajax flag isn&amp;#039;t set, it will output a normal page&lt;br /&gt;
if (!$ajax) {&lt;br /&gt;
    echo $OUTPUT-&amp;gt;header();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
echo $OUTPUT-&amp;gt;heading(&amp;#039;Your form heading&amp;#039;);&lt;br /&gt;
&lt;br /&gt;
$f = new your_custom_form();&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
//$f-&amp;gt;handle() is a custom update method in your form class&lt;br /&gt;
if($f-&amp;gt;handle()) {&lt;br /&gt;
  echo &amp;#039;Your custom update success message&amp;#039;;&lt;br /&gt;
}else {&lt;br /&gt;
  $f-&amp;gt;display();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
//Note if the $ajax flag isn&amp;#039;t set, it will output a normal page&lt;br /&gt;
if (!$ajax) {&lt;br /&gt;
    echo $OUTPUT-&amp;gt;footer();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The JavaScript:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
//event handlers&lt;br /&gt;
YUI().use(&amp;#039;node-base&amp;#039;, function(Y) {&lt;br /&gt;
    function init() {&lt;br /&gt;
     //We need to create a hidden div to act as the container for the modal popup&lt;br /&gt;
      var yui_act_sel_dialog = Y.one(&amp;#039;#yui_act_sel_dialog&amp;#039;);&lt;br /&gt;
        if (!yui_act_sel_dialog) {&lt;br /&gt;
            var el = document.createElement(&amp;#039;div&amp;#039;);&lt;br /&gt;
            el.id = &amp;#039;yui_act_sel_dialog&amp;#039;;&lt;br /&gt;
            el.style = &amp;#039;display:none;&amp;#039;;&lt;br /&gt;
            document.getElementsByTagName(&amp;#039;body&amp;#039;)[0].appendChild(el);&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
       //links which have the pop_up_selector_link class will be turned into modal form windows&lt;br /&gt;
        Y.all(&amp;quot;.pop_up_selector_link&amp;quot;).on(&amp;#039;click&amp;#039;, function(e) {&lt;br /&gt;
            var a = new com.uol.PopupHandler(e.currentTarget.get(&amp;#039;href&amp;#039;), false);&lt;br /&gt;
            a.ajax();&lt;br /&gt;
            //e.stopPropagation works only in Firefox,Safari etc, not ie.&lt;br /&gt;
            if (e.preventDefault) {&lt;br /&gt;
                e.preventDefault();&lt;br /&gt;
            }&lt;br /&gt;
            return false;&lt;br /&gt;
        });&lt;br /&gt;
&lt;br /&gt;
       //links which have the pop_up_selector_link_cancel_only class will be turned into modal display only windows&lt;br /&gt;
        Y.all(&amp;quot;.pop_up_selector_link_cancel_only&amp;quot;).on(&amp;#039;click&amp;#039;, function(e) {&lt;br /&gt;
            var a = new com.uol.PopupHandler(e.currentTarget.get(&amp;#039;href&amp;#039;), true);&lt;br /&gt;
            a.ajax();&lt;br /&gt;
            //e.stopPropagation works only in Firefox,Safari etc, not ie.&lt;br /&gt;
            if (e.preventDefault) {&lt;br /&gt;
                e.preventDefault();&lt;br /&gt;
            }&lt;br /&gt;
            return false;&lt;br /&gt;
        });&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    Y.on(&amp;quot;domready&amp;quot;, init);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
});&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The custom JavaScript class which will create the popup&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
if (typeof com == &amp;#039;undefined&amp;#039;) {&lt;br /&gt;
    com = {};&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
if (typeof com.uol == &amp;#039;undefined&amp;#039;) {&lt;br /&gt;
    com.uol = {};&lt;br /&gt;
}&lt;br /&gt;
(function() {&lt;br /&gt;
    /**&lt;br /&gt;
     * Constructor for the PopupHandler class&lt;br /&gt;
     * @param url&lt;br /&gt;
     * @param cancel_button_only&lt;br /&gt;
     * @param width&lt;br /&gt;
     */&lt;br /&gt;
    this.PopupHandler = function(url, cancel_button_only, width) {&lt;br /&gt;
        this.url = url;&lt;br /&gt;
        //add the ajax flag into the url&lt;br /&gt;
        this.url += &amp;#039;&amp;amp;ajax=1&amp;#039;;&lt;br /&gt;
        this.cancel_button_only = cancel_button_only;&lt;br /&gt;
        this.width = width;&lt;br /&gt;
        if (this.width == null) {&lt;br /&gt;
            this.width = 650;&lt;br /&gt;
        }&lt;br /&gt;
        this.tiny_mce = false;&lt;br /&gt;
    },&lt;br /&gt;
&lt;br /&gt;
        /**&lt;br /&gt;
        * We need to set up a tiny mce instance if the form has a rich text element on it&lt;br /&gt;
        */&lt;br /&gt;
        this.PopupHandler.prototype.html_editor = function() {&lt;br /&gt;
            if (this.tiny_mce) {&lt;br /&gt;
                return;&lt;br /&gt;
            }&lt;br /&gt;
            this.tiny_mce = true;&lt;br /&gt;
            tinyMCE.init({&lt;br /&gt;
                mode : &amp;quot;textareas&amp;quot;,&lt;br /&gt;
                theme : &amp;quot;advanced&amp;quot;,&lt;br /&gt;
                skin : &amp;quot;o2k7&amp;quot;,&lt;br /&gt;
                &amp;quot;width&amp;quot;: 300,&lt;br /&gt;
                skin_variant : &amp;quot;silver&amp;quot;,&lt;br /&gt;
                plugins : &amp;quot;advimage,safari,table,style,layer,advhr,advlink,emotions,inlinepopups,searchreplace,paste,directionality,fullscreen,moodlenolink,nonbreaking,contextmenu,insertdatetime,save,iespell,preview,print,noneditable,visualchars,xhtmlxtras,template,pagebreak,spellchecker,dragmath,moodlemedia&amp;quot;,&lt;br /&gt;
                theme_advanced_buttons1 : &amp;quot;fontselect,fontsizeselect,formatselect,|,undo,redo,|,search,replace,|,fullscreen&amp;quot;,&lt;br /&gt;
                theme_advanced_buttons2 : &amp;quot;bold,italic,underline,strikethrough,sub,sup,|,justifyleft,justifycenter,justifyright,|,cleanup,removeformat,pastetext,pasteword,|,forecolor,backcolor,|,ltr,rtl&amp;quot;,&lt;br /&gt;
                theme_advanced_buttons3 : &amp;quot;bullist,numlist,outdent,indent,|,link,unlink,moodlenolink,|,image,moodlemedia,dragmath,nonbreaking,charmap,table,|,code,spellchecker,|,anchor&amp;quot;,&lt;br /&gt;
                theme_advanced_toolbar_location : &amp;quot;top&amp;quot;,&lt;br /&gt;
                theme_advanced_toolbar_align : &amp;quot;left&amp;quot;,&lt;br /&gt;
                theme_advanced_statusbar_location : &amp;quot;bottom&amp;quot;,&lt;br /&gt;
                theme_advanced_resizing : true,&lt;br /&gt;
                theme_advanced_fonts : &amp;quot;Trebuchet=Trebuchet MS,Verdana,Arial,Helvetica,sans-serif;Arial=arial,helvetica,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,times new roman,times,serif;Tahoma=tahoma,arial,helvetica,sans-serif;Times New Roman=times new roman,times,serif;Verdana=verdana,arial,helvetica,sans-serif;Impact=impact;Wingdings=wingdings&amp;quot;,&lt;br /&gt;
                relative_urls : &amp;quot;false&amp;quot;,&lt;br /&gt;
                apply_source_formatting : &amp;quot;true&amp;quot;,&lt;br /&gt;
                remove_script_host : &amp;quot;false&amp;quot;,&lt;br /&gt;
                entity_encoding : &amp;quot;raw&amp;quot;,&lt;br /&gt;
                theme_advanced_resize_horizontal : &amp;quot;true&amp;quot;&lt;br /&gt;
            });&lt;br /&gt;
        };&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    /**&lt;br /&gt;
     * Method to call load the form&lt;br /&gt;
     */&lt;br /&gt;
    this.PopupHandler.prototype.ajax = function() {&lt;br /&gt;
        //Assignment call to solve the scope problem in ajax_callback&lt;br /&gt;
        this.ajax_callback.argument[0] = this.cancel_button_only;&lt;br /&gt;
        this.ajax_callback.argument[1] = this.width;&lt;br /&gt;
        this.ajax_callback.argument[2] = this.html_editor;&lt;br /&gt;
       //make the ajax call&lt;br /&gt;
        YAHOO.util.Connect.asyncRequest(&amp;#039;GET&amp;#039;, this.url, this.ajax_callback, null);&lt;br /&gt;
    },&lt;br /&gt;
&lt;br /&gt;
        this.PopupHandler.prototype.ajax_callback = {&lt;br /&gt;
            success: function(e) {&lt;br /&gt;
                document.getElementById(&amp;#039;yui_act_sel_dialog&amp;#039;).innerHTML = e.responseText;&lt;br /&gt;
                var html = e.argument[2];&lt;br /&gt;
                html();&lt;br /&gt;
&lt;br /&gt;
                var activity_dialog = new YAHOO.widget.Dialog(&amp;#039;yui_act_sel_dialog&amp;#039;, {&lt;br /&gt;
                    modal: true,&lt;br /&gt;
                    width: e.argument[1] + &amp;#039;px&amp;#039;,&lt;br /&gt;
                    top:&amp;#039;200px&amp;#039;,&lt;br /&gt;
                    iframe: false,&lt;br /&gt;
                    zIndex: 2000,&lt;br /&gt;
                    fixedcenter: true,&lt;br /&gt;
                    visible: false,&lt;br /&gt;
                    close: true,&lt;br /&gt;
                    constraintoviewport: false,&lt;br /&gt;
                    postmethod: &amp;#039;async&amp;#039;,&lt;br /&gt;
                    hideaftersubmit:true&lt;br /&gt;
                });&lt;br /&gt;
&lt;br /&gt;
                activity_dialog.cancel_button_only = this.cancel_button_only;&lt;br /&gt;
&lt;br /&gt;
                var onSuccess = function(o) {&lt;br /&gt;
                    document.getElementById(&amp;#039;feedback_text&amp;#039;).innerHTML = o.responseText;&lt;br /&gt;
                    window.setTimeout(&amp;quot;window.location.reload(true);&amp;quot;, 2000);&lt;br /&gt;
&lt;br /&gt;
                };&lt;br /&gt;
                var onFailure = function(o) {&lt;br /&gt;
                    alert(&amp;quot;Your submission failed. Status: &amp;quot; + o.status);&lt;br /&gt;
                };&lt;br /&gt;
                activity_dialog.callback.success = onSuccess;&lt;br /&gt;
                activity_dialog.callback.failure = onFailure;&lt;br /&gt;
&lt;br /&gt;
                var handleCancel = function() {&lt;br /&gt;
                    this.cancel();&lt;br /&gt;
                };&lt;br /&gt;
                //add a submit button if required&lt;br /&gt;
                if (!e.argument[0]) {&lt;br /&gt;
                    var handleSubmit = function() {&lt;br /&gt;
                        this.submit();&lt;br /&gt;
                    };&lt;br /&gt;
                }&lt;br /&gt;
&lt;br /&gt;
                var myButtons = [];&lt;br /&gt;
                if (!e.argument[0]) {&lt;br /&gt;
                    myButtons.push({ text: &amp;quot;Submit&amp;quot;, handler: handleSubmit, isDefault: true });&lt;br /&gt;
                }&lt;br /&gt;
                myButtons.push({ text: &amp;quot;Cancel&amp;quot;, handler: handleCancel });&lt;br /&gt;
                activity_dialog.cfg.queueProperty(&amp;quot;buttons&amp;quot;, myButtons);&lt;br /&gt;
                activity_dialog.render();&lt;br /&gt;
                activity_dialog.show();&lt;br /&gt;
            }&lt;br /&gt;
            ,&lt;br /&gt;
            failure: function(e) {&lt;br /&gt;
&lt;br /&gt;
            },&lt;br /&gt;
            argument: [this.cancel_button_only]&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
}).call(com.uol);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>Kevinslondon</name></author>
	</entry>
</feed>