Wednesday, June 29, 2005

Maximum MaxLength

I came across an interesting quirk with Firefox today. Don't even ask why or how, but I found that the maximum MaxLength for a textbox rendered in Firefox is

(2^26) - 1

For the math illiterate, that equates to 67,108,863. If you set the MaxLength to anything higher than this and render the textbox in Firefox, you will not be able to enter anything into the textbox.

You can try it yourself. Here's a couple samples:

<input id="validTextbox" maxlength="67108863" type="text" value="">

<input id="invalidTextbox" maxlength="67108864" type="text" value="">

Update: Opera has the same limitation as Firefox.

No comments: