3

I've seen the same thing enough times now that it's sparked my curiosity. It's even on this site!

The <input id=title ... > element on the "https://stackoverflow.com/questions/ask" sets maxlength=300 and data-max-length="150".

Namely, the input box will allow you to type 300 characters into it, but the form will not accept anything above 150.

Is there a reason one might do this?

Community
  • 1
  • 1
TheRealFawby
  • 112
  • 8
  • Fawby, it is for allowing 300 characters and use required 150 characters but you can use the 300 characters in other sections of the page using document.getElementById ...something like submiting ACRONYMS and using complete characters in other sections of the page – Naga Sai A Jul 11 '16 at 19:44

1 Answers1

1

It's most likely to prevent user from loosing end of the text while not noticing that input is limited or when pasting. After getting an error user can edit input while text is intact.

exabyssus
  • 451
  • 2
  • 9