form submit not working in firefox but works fine in IE

烈酒焚心 提交于 2020-01-01 14:56:52

问题


I want to submit my parent page when I click on submit button of the child page. In my child page I've written my code as

string scriptString = "<script language=JavaScript> window.opener.document.forms(0).submit(); </script>";

            // ASP.NET 2.0

            if (!Page.ClientScript.IsClientScriptBlockRegistered(scriptString))
            {

                Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "script", scriptString);

            }

it is working fine in IE but not working in Firefox. What could be the alternate method for this?

Thank in advance


回答1:


try to replace forms(0) with forms[0]

I don't think Firefox likse parentheses for arrays.



来源:https://stackoverflow.com/questions/2928783/form-submit-not-working-in-firefox-but-works-fine-in-ie

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!