Kevin Marks
It’s also a Ruby thing. Python handles multiple inputs with the same name a bit better.
Well, this is timely! Just today I was having a really good natter with Charlotte about using checkboxes, specifically sending multiple values to the server:
You’ll notice that the
namegiven to each of these checkboxinputelements is the same: “reservation-requested-device[]”. The square brackets (“[]”) at the end of thenameare the magic bit that allows the values of each chosen “reservation-requested-device” checkbox to be submitted as the value of “reservation-requested-device”.
See, I wasn’t sure whether that was just a PHP thing (the only server-side input-handling I’ve had much experience of) or whether it was a more general way of sending multiple values.
Update: It seems that the square brackets are indeed a PHP thing. Multiple values will be sent in any case. See this test case.
It’s also a Ruby thing. Python handles multiple inputs with the same name a bit better.
For a python example, I can make a form like this: http://www.headsuptutoring.com/grid?pagetitle=%27oo%27+sound&top=s&top=p&top=oo&top=n&top=oo&top=ue&top=ew&letr=p&letr=r&letr=u&letr=n&letr=e&letr=&letr=&letr=s&letr=ou&letr=p&letr=r&letr=oo&letr=m&letr=&letr=b&letr=oo&letr=t&letr=n&letr=ew&letr=t&letr=oo&letr=b&letr=l&letr=ue&letr=g&letr=l&letr=ue&letr=&letr=s&letr=oo&letr=n&letr=m&letr=oo&letr=n&letr=&letr=t&letr=r&letr=ue&letr=g&letr=r&letr=ew&letr=&letr=t&letr=u&letr=n&letr=e&letr=f&letr=l&letr=ew&letr=u&letr=&letr=e&letr=&letr=&letr=th&letr=r&letr=ough&letr=&letr=&letr=&letr=&letr= and the backend handler just loops over the array
dialog, details, datalist, progress, optgroup, and more:
If this article helps just a single developer avoid an unnecessary Javascript dependency, I’ll be happy. Native HTML can handle plenty of features that people typically jump straight to JS for (or otherwise over-complicate).
When haters deny HTML’s status as a programming language, they’re showing they don’t understand what a language really is. Language is not instructing an interlocutor what to do in a way that leaves no room for other interpretations; it is better and richer than that. Like human language, HTML is conversational. It is remarkably adept at adapting to context. It can take a different shape on any machine, from a desktop browser or an e-reader screen to a mobile app or a screen reader for the blind (so long as that device is built to present hypertext).
Hell, yeah!
Ultimately, even as HTML has become the province of professionals, it cannot be gatekept. This is what makes so many programmers so anxious about the web, and sometimes pathetically desperate to maintain the all-too-real walls they’ve erected between software engineers and web developers.
Hell, yeeeeaaaaahhh!!!
What other programmers might say dismissively is something HTML lovers embrace: Anyone can do it. Whether we’re using complex frameworks or very simple tools, HTML’s promise is that we can build, make, code, and do anything we want.
It’s pretty easy to write bad HTML, because for most developers there are no consequences. If you write some bad Javascript, your application will probably crash and you or your users will get a horrible error message. It’s like a flashing light above your head telling the world you’ve done something bad. At the very least you’ll feel like a prize chump. HTML fails silently. Write bad HTML and maybe it means someone who doesn’t browse the web in exactly the same way as you do doesn’t get access to the information they need. But maybe you still get your pay rise and bonus.
So it’s frustrating to see the importance of learning HTML dismissed time and time again.
Garrett talks through some handy HTML attributes: spellcheck, autofocus, autocapitalize, autocomplete, and autocorrect:
While they feel like small details, when we set these attributes on inputs, we streamline things for visitors while also guiding the browser on when it should just get out of the way.
Here’s a nice HTML web component that uses structured data in the markup to populate a Leaflet map.
Personally I’d probably use microformats rather than microdata, but the princple is the same: progressive enhancement from plain old HTML to an interactive map.
HTML’s new `command` attribute on the `button` element could be a game-changer.
An alternate route to a declarative version of the Web Share API.
A lazy option for responsive images is at hand.
Don’t replace. Augment.
Ideas for some declarative shortcuts.