A little HTML test
Below lies the code for an HTML page. See if you can tell me why the form submits fine in Firefox, but the submit button doesn’t do anything in Internet Explorer.
<html>
<head>
<title>Test page</title>
</head>
<body>
<form>
<textarea>
1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
</textarea>
<textarea>
1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
</textarea>
<input type="submit">
</form>
</body>
</html>
The answer is not “it’s a bug in IE! IE sux0rs!“. I’m not clear what correct behaviour here is, but IE is defensibly doing the right thing, at least possibly. Your thoughts? And I’ll give you the answer later.
The form lacks a name or a method; how is it to be submitted (GET or POST)? What is it to be called by?
3 hours later
Hi sil,
I think that the problem come from the form.
As you don’t specifie the method, it will be “GET” by default.
The problem is that IE could not take more than 2043 characters on a “GET” method, fyi : http://support.microsoft.com/kb/q208427/
So I think this is why the form could not be submit.
3 hours later
Actually, this is not the only reason of the non-submitting form.
As defined by the WC3, the form submitting process is in 4 step :
Most interesting is the first step : Identify the successful controls :
A successful control is “valid” for submission. Every successful control has its control name paired with its current value as part of the submitted form data set. A successful control must be defined within a FORM element and must have a control name.
Actually, this would not solve the problem because, we will still have the 2043 character limit with IE.
4 hours later
You haven’t provided an action for the form either. Where would the data be submitted?
4 hours later
The default action for a form is the current page, yes? And the default method is GET? So it doesn’t matter that the form has neither of these attributes. The character limit doesn’t apply because the textboxes aren’t successful.
So you’re left with a form submitting no data, with GET, to the current URL. We expect that to behave the same as clicking a link to the current page. Would I be right in guessing that IE doesn’t reload the page in that case either? Basically, the result of the form submission is cached, so it doesn’t submit.
4 hours later
I would say, the two textareas are not to be kept apart, because they both have no name. So IE tries to be neat to the user and dont send trash. With the post and get-issue I think there is a default? That should not be the problem.
13 hours later
There are two things that are stopping IE submitting the form.
The first is the lack of names for the textareas. All form controls (except submit buttons) require a
nameorid. Note that Aurelien was wrong when he said the form element itself requires naming as well.The second issue is the length of the generated URL. The form will be submitted as a
GETby default (themethodattribute is not required) and the URL generated would exceed the 2048 character limit set by Internet Explorer. From Boutell :The missing ACTION, which is a required attribute of
form, is not actually a factor preventing IE from submitting the form.21 hours later
Aurelien gets the pont for getting it right first, and Mr Rutter gets a bonus point for explaiing in more detail. (The missing names on the textareas were there in my test case; I forgot to add them to the test above). It took me Some Time to work out why it wasn’t working :)
23 hours later
these all sound like great answers. seems like a collaberation of the answers already posted are enough reason for the form not to submit.
i haven’t tested it, but I wonder what gets submitted? can you access the results via $_REQUEST on the result page? since they don’t have names, wouldn’t they be accessible by index? via:
$_REQUEST[0] (textarea1) $_REQUEST[1] (textarea2)
is it so bad to call this a bug? However, in the end, who would develop a form that looks like that anyway? Oh yea, this is just a test.
2 days later
Which version of IE are you using? I just stuck the code into an ASP page so I could drop into the debugger on the server; the form submits with an empty query string, which is the same behaviour as Mozilla/Firefox. This is on IE version (deep breath) 6.0.2900.2180.xpsp_sp2_gdr.050301-1519
(I presume that will all go back down to “7” soon…)
4 days later
Nick: must have been fixed in XPSP2, then; I’m in Win2K.
4 days later
dasd
5 days later
dasd
5 days later
I actually ran into this exact issue and thus found this article when searching for a solution. The form we had did not have a method applied, and thus was defaulting to “GET”. I switched it to “POST” and the form works fine now.
31 weeks later
The HTML specifications technically define the difference between “GET” and … If the form data would contain non-ASCII characters, then METHOD=”GET” is correct other METHOD=”GET” is not working properly. In METHOD=”GET” send only upto 2KB (2048) characters
71 weeks later