Re: Multiple text input

It means for example
`<input type=text multiple name="tags[]" /> insert  the tags for this
article`, a control present in several websites.

Basically I had this idea because of `<datalist>`. I had to implement a
custom js way to show the suggestion box multiple times for something
similar to a tag system (it's not a production web app so I didn't want
anything too complicated).

This feature exists in real world and allows to insert multiple tags,
possibly picking them from a suggestion list, when the author doesn't know
in advance whether strings will belong to the list, nor how many strings
will be inserted.

If implementers are interested in adopting a native system for a widespread
feature, I guess there are three possible ways to do that:

- implement `multiple` in text input and capture each value separately
(e.g. when user presses enter);
- implement `datalist` on textarea, stating that suggestions are to be
shown on newline;
- allow authors to indicate a separator character, which also makes
suggestions appear again. Then it's up to the author to handle the input
concatenation, in a way similar to email fields (but unlike email, you
cannot state in advance which character the input splits on).

In light of the extension of datalist, my favourite alternative is the
second, of course, because it's the most natural: newline is a perfect
separator character and it doesn't need explanations to the user, control
value is easy to scroll and edit, and this feature would provide no exotic
interface on an established element as an <input type=text multiple> field
would.
But I was curious whether or not this feature had ever been discussed.

Received on Friday, 7 October 2016 10:41:27 UTC