HTML输入表单(在InternetExplorer中)值的最大长度是多少?

What is the max-length of the value for an HTML input form (in InternetExplorer)

本文关键字:多少 表单 输入 InternetExplorer HTML      更新时间:2023-09-26

我没能在任何地方找到这个,要么是因为它是未定义的,这是一个愚蠢的问题,我很快就会发现,或者是因为我使用了错误的术语。

我可以在HTML表单输入字段中输入的最大数据量是多少?特别是ie7、ie8和ie9(如果有关系的话)。

我正在转换以前通过查询字符串传递信息的应用程序,IE对URL的最大长度约为2048,因此该方法具有客户端遇到的严重数据限制。

我读到(没有引用),IE的表单帖子可以包含多达70K的信息,所以这似乎更合理。但我要确保我没有碰到限制。这是一个动态创建的表单。

之前,应用程序只发送documentid;现在我要通过JSON发送一大堆数据。在表单字段中进行字符串化(如果这是一个愚蠢的想法,我相信您会指出来)。

它的目标是一个隐藏的iFrame,因为服务器返回一个。csv文件,用户应该被提示下载,IE只会从iFrame(没有使用其他浏览器,应用程序在IIS6下运行)。

var post_to_url = function (path, params, method) {
    method = method || "post"; // Set method to post by default, if not specified.
    var form = document.createElement("form");
    form.setAttribute("method", method);
    form.setAttribute("action", path);
    form.setAttribute("target", "appFrame");
    var hiddenField = document.createElement("input");
    hiddenField.setAttribute("type", "hidden");
    hiddenField.setAttribute("name", "data");
    hiddenField.setAttribute("value", JSON.stringify(params));
    form.appendChild(hiddenField);
    document.body.appendChild(form);
    form.submit();
};

这是由服务器端控制的。既然你使用的是ASP。NET是Web的maxRequestLength元素。配置

http://msdn.microsoft.com/en-us/library/e1f13641 (v =应用程序). aspx