Question

I have this simple hidden form whose purpose is to redirect the response to a new window on a button click. It works perfect in Internet Explorer 9 and chrome but gives me a warning message in firefox 11 when popup block is on.

Error Message

Form was unable to be submitted. The most likely cause for this is an invalid value in an upload field.

while I am no where trying to upload any files.

DynamicForm code

dojo.provide("amk.geo.DomainCore.forms.SearchForm");

amk.geo.DomainCore.forms.SearchForm = function() {

    /**
     * Resource bundle.
     * @type Object
     */
    this.bundle = amk.geo.tools.bundles.Application;

    this.formID = null;

    this.controller = null;

    this.resBundle = amk.geo.app.framework.controller.AppController.getResourceBundle("amk.geo.DomainCore.Resources");

    this.initWidget = function() {
            this.Super("initWidget", arguments);
            this.formID = "SearchForm";
            var params = [        
                {type: "hidden", name: "EMAIL_ID" },
                {type: "hidden", name: "PORTAL_PSSWD"},
                {type: "hidden", name: "PROJECT_ID"},
                {type: "hidden", name: "fsquery"},
                {type: "hidden", name: "PRODUCT_VER"},
                {type: "hidden", name: "PRODUCT_NAME"},
                {type: "hidden", name: "ORIGIN"}             
            ];
            this.setItems(params);
            this.action = "https://xxxx.com/default.asp";
            this.method = "POST";
            this.target = "_blank";
            this.canSubmit = true;

    };

    this.onLoad = function(){
        this.submit();
    }
}
// define class
isc.ClassFactory.definePackageClass(
    "amk.geo.DomainCore.forms.SearchForm",    // class name
    isc.DynamicForm     // superclass
);

How can I get rid of this warning message? (If I add an exception to the popup blocker, it redirects without any warning message)

*Warning message in Firefox

Please help. Thankyou

Was it helpful?

Solution

I got a solution to my problem by adding the below lines after onLoad function

// Override DynamicForm formSubmitFailed function to disable warning alert in Firefox v11 when popups are blocked
this.formSubmitFailed = function(){}

You can even check SmartClient document for more information.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top