I’m creating a very simple form that has a text area. The text area takes in a formatted block of names separated by newlines. To make the application slightly more useable, it would be nice if I could include a placeholder example that had multiple lines of text. Unfortunately, that doesn’t seem to be possible with the HTML5 specification. Does anybody know why?
Share
<placeholder>is like<blockquote>to me. It has a specific niche.In the case of the
<placeholder>attribute, it’s mainly used in one-line form fields; not text areas.How often do you use a carriage return in a one-line form field? Never.
The <placeholder> attribute represents a short hint (a word or short phrase) intended to aid the user with data entry. A hint could be a sample value or a brief description of the expected format. The attribute, if specified, must have a value that contains no U+000A LINE FEED (LF) or U+000D CARRIAGE RETURN (CR) characters.Since HTML5 is still fresh, new, and continues to be optimized and tweaked in various browsers; who knows what crazy things would happen cross browser-wise if the
<placeholder>attribute didn’t have such strict guidelines set up?The web seems to be moving in the direction to help designers/developers type less code, and make less mistakes.
I’ve seen a few posts (by people like Paul Irish and Jeffrey Way) talking about omitting things like closing tags, and many standard elements have been modified in HTML5 to be shorter/easier (e.g.
<!doctype html>). Also, what used to be traditional attributes required to make a webpage function well can now be easily thrown out all together. The web is getting simpler, and more complex at the same time.All in all though, if you’re wanting something to fix the dilemma (that you are seemingly suffering from by the tone of your question), then just use the
<title>attribute instead. Refer to the selected answer in the question located at the following link:Can you have multiline HTML5 placeholder text in a <textarea>?