ftimme
2012-02-27 74c2c0f3a47dc5ba992b17d1acb8f5e9155a5f8e
- Added JavaScript function submitFormConfirm(formname,target,confirmation){} that display a confirmation message before a form is submitted.
1 files modified
25 ■■■■■ changed files
interface/web/js/scrigo.js.php 25 ●●●●● patch | view | raw | blame | history
interface/web/js/scrigo.js.php
@@ -130,6 +130,31 @@
    */
}
function submitFormConfirm(formname,target,confirmation) {
    if(window.confirm(confirmation)) {
        var submitFormObj = jQuery.ajax({    type: "POST",
                                            url: target,
                                            data: jQuery('#'+formname).serialize(),
                                            dataType: "html",
                                            success: function(data, textStatus, jqXHR) {
                                                if(jqXHR.responseText.indexOf('HEADER_REDIRECT:') > -1) {
                                                    var parts = jqXHR.responseText.split(':');
                                                    //alert(parts[1]);
                                                    loadContent(parts[1]);
                                                    //redirect = parts[1];
                                                    //window.setTimeout('loadContent(redirect)', 1000);
                                                } else {
                                                    jQuery('#pageContent').html(jqXHR.responseText);
                                                }
                                            },
                                            error: function(jqXHR, textStatus, errorThrown) {
                                                var parts = jqXHR.responseText.split(':');
                                                reportError('Ajax Request was not successful. 111');
                                            },
                                    });
    }
}
function submitUploadForm(formname,target) {        
    var handleResponse = function(loadedFrame) {
        var response, responseStr = loadedFrame.contentWindow.document.body.innerHTML;