iPad Chrome - 在新窗口/标签中提交表单无效

时间:2022-11-23 16:45:52

We develop c# .NET application, javascript and using EXTJS (6.0.2). Application work fine with all browser at PC platforms but for iPad Chrome we have problem with submit form in new window/tab the new window/tab will not open.

我们开发c#.NET应用程序,javascript并使用EXTJS(6.0.2)。应用程序适用于PC平台上的所有浏览器,但对于iPad Chrome,我们在新窗口/选项卡中提交表单时出现问题,新窗口/选项卡将无法打开。

here is code ...

这是代码......

test.init = function (config) {

    var submitButtonHandler = function (scope, eArgs) {
        var params = {
            q: 'test',
        };

        submitForm.submit({
            params: params
        });

    }


    var action = 'https://www.google.com/';
    var hiddenFormValues = Ext.create('Ext.Component', {});
    var submitForm = Ext.create('Ext.form.Panel', {
        autoEl: {
            tag: 'form',
            method: 'post',
            target: '_blank',
            action: action
        },
        buttons: [{
            text: 'Click to test',
            handler: submitButtonHandler,
            exportMethod: 'openhtml',
            xtype: 'TestButton'
        }],

        submit: function (config) {
            config.params = config.params || {};
            var keys = Object.keys(config.params);
            var html = '';
            for (var i = 0; i < keys.length; i++) {
                var key = keys[i];
                var value = config.params[key];
                if (typeof (value) === "string") value = value.replace(/'/g, "&#39;");
                html += '<input type="hidden" name="' + key + '" value=\'' + value + '\'/>';
            }
            alert(html);
            hiddenFormValues.update(html);
            alert(this.id);
            document.getElementById(this.id).submit();
        }

    })

    return submitForm;
}

For PC chrome open the new tab window just fine

对于PC chrome,打开新的选项卡窗口就好了

BUT for iPad chrome will not open then new/tab window, not working.

但是对于iPad镀铬将无法打开然后新的/标签窗口,无法正常工作。

Any suggestions are appreciated, Thank you

任何建议表示赞赏,谢谢

1 个解决方案

#1


0  

if (form.isValid()) {
  form.submit({
    url: 'http://localhost:8080/WAR_project/rest/service/ticket/uploadfile',
    waitMsg: 'Uploading Please Wait...',
    method: 'POST',                    
    success: function (r, a) {
      console.log('success message here')
    },
    failure: function (r, a) {                    
      console.log('failure message here')
    }
  });
}

#1


0  

if (form.isValid()) {
  form.submit({
    url: 'http://localhost:8080/WAR_project/rest/service/ticket/uploadfile',
    waitMsg: 'Uploading Please Wait...',
    method: 'POST',                    
    success: function (r, a) {
      console.log('success message here')
    },
    failure: function (r, a) {                    
      console.log('failure message here')
    }
  });
}