[thelist] Only IE-pc doesn't want to send form?

Pieter Roosens pieter at roosensdesign.com
Tue Feb 14 14:20:20 CST 2006


Op 14-feb-06, om 20:33 heeft Roger Ly het volgende geschreven:

>> Weird behavior of IE-PC, which doesn't send the "ORDER" form, while
>> all other browsers on PC and Mac do indeed IFAIK.
>
> It looks like the amount of data you are sending via GET is too  
> long for my
> Win2K/IE6.0.2800.1106.
>
> I started to play around with your form, removing items, etc, and  
> found that
> if I removed enough things, it would submit fine.  Otherwise, it  
> wouldn't
> even attempt to submit the form.  (form.onsubmit was being fired,  
> but IE
> wouldn't attempt to process the URL.)
>
> After playing around with things, it looks like the final URL which  
> IE is
> being told to go to is just too long.  I played around with things  
> a little
> and it looks like your full URL is over 2000 characters when  
> submitted (with
> no data!).  Some unconfirmed playing around seems to indicate that  
> IE won't
> attempt to process the URL if it is generated to be longer than 2101
> characters.
>
> Here is the test I did:
> 		function mySubmit()
> 		{
> 			var myForm = document.forms[0]
> 			var output = '';
> 			for (i = 0; i < myForm.elements.length; i++)
> 			{
> 				if (output != '')
> 				{
> 					output += '&';
> 				}
> 				output += escape(myForm.elements[i].name) +
> '=';
> 				output += escape(myForm.elements[i].value);
> 			}
> 			output = myForm.action + '?' + output;
> 			alert(output.length);
> 		}
>
> Basically, took the action of the form, appended ? and a bunch of  
> escaped
> name/value pairs.  This is under the assumption that the javascript  
> escape
> is similar to the mechanism that IE uses to create the GET URL after
> processing each form element.
>
> On another note:  If I take the result of the function that I wrote  
> and
> paste that URL into IE's address bar, even more of it gets  
> cropped.  It
> looks like a 2102 character URL is too long for IE by around 55  
> characters,
> making it look like IE's max URL is closer to 2046 (which is close  
> to 2048,
> so it sounds reasonable).
>
> Basically, you'll need to swap out your form action from a GET to a  
> POST, or
> significantly shrink the size of your form.  Keep note that even  
> getting the
> input fields below a certain threshold may not help you with GETs  
> since a
> user can type a ton of data in any of the form fields.
>
> HTH,
>
> Roger
>
Hi Roger, thanks a lot. You're an expert. I'm not a code-man.
I think the switch to POST will solve the problem.
I'll try that tomorrow cause I don't have the site here at my office.

Will let you know how it works out ...
Pieter
-----------------------------------------
http://www.roosensdesign.com




More information about the thelist mailing list