[whatwg] Text areas with pattern attributes?

Chris Taylor Chris.Taylor at figureout.com
Mon Aug 24 09:08:12 PDT 2009

Smylers wrote:
> Are there currently sites using JavaScript to perform the above checks
> pre-submission?
> The point is to have cases specifically _for_ it -- not adding
> everything for which there isn't a reason against.
> If <textarea pattern=...> wouldn't in practice be used by authors then
> there's no point in adding it.  If it would be used then it should be
> trivial to show some places where it would be used.

It's been mentioned before about limiting the length of text permissible in a <textarea> element, specifically for forums. Part of my JavaScript library-ish thing makes this slightly easier for authors to use: http://performerjs.org/docs/limiter. I have no data about which sites the Performer script is used on, unfortunately.

The other types of patterns I can imagine being used include text where newlines may be required at certain points for example CSV data, or lists that will be parsed into separate items server-side. Also a pattern to respond to certain words, for example qualifications (e.g. "Doctorate" or "Degree"). Also for spam checking, although as we all know too well it is almost impossible to completely stop the input of unwanted words. IRT also has a couple of script examples involving textareas, however these may be more complex than the spec pattern attribute can handle [1].




This message has been scanned for malware by SurfControl plc. www.surfcontrol.com

More information about the whatwg mailing list