开发者

Workaround for too long querystring in IE6, IE7?

I have a form which submits fine in FF, Opera, Safari, Chrome, and also IE8... But it wont submit in IE6, or IE7...

I have noticed it is 99% sure that the problem is a too long querystring. I have many many options...

Now, changing the method to POST is out of the question here, so don't bother asking about this please...

I wonder, is there any other workaround for this problem? Also, why is only IE6 and IE7 having this problem?

If there is no workaround, w开发者_如何学编程ill "disabling" the "too many" inputs which are over the limit help shortening the querystring? In other words, will disabled form elements also be added to the querystring?

Thanks


To answer your second question, Microsoft's got the answer here: http://support.microsoft.com/kb/208427 The maximum URL is 2,083 characters, so the page resulting from the GET request must have a URL shorter than that.

To answer your third question, w3.org/TR/html401/interact/forms.html#h-17.12: "Disabled controls can not be successful", i.e. they will not submit.

To answer your first, perhaps you can put a character limit on some of the fields, like a textarea. Another option might be to compress the input using javascript, hashing it somehow, and then unhashing it server-side on the submitted page.


If you're sure that that's the issue, and not the million other cross browser problems, you could try an ajax call. Split up the query into 2, 3, n calls.

Is it just a form? May I ask why POST is out of the question?


its not great, but you could putt the value(s) in a cookie


To answer your last question first Disabled form inputs are NOT GETted or POSTed back to the server

If posting isn't an option, you can try eliminate non-essential form inputs, and although cheesy, reduce the length of the NAMEs of your elements will also shorten the Querystring.


You can also try to do some client side compression of the query string values in JavaScript.

I have had some success using base 93 encryption to get a significant reduction in string size.

You can also try huffman compression, although it is more processor heavy.

http://rumkin.com/tools/compression/compress_huff.php

If you are only expecting a limited character set (lowercase a-z) you could come up with a few other tricks.


Query string too long error can be avoided by a simple IIS settings change. http://www.mytecbits.com/microsoft/iis/query-string-too-long

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜