10 minutes ago · 22 min read4321 words · Tech · hide

Y’know the example text you sometimes see in input fields on web forms? It turns out that that’s called a placeholder. In Django, to add placeholders, you set an attribute on the widget for the appropriate form field. When I searched for the best way to do this, I ended up finding roughly three ways people do it in practice. Here’s what I learned. Three paths to adding placeholders to form fields in Django. I’m sure you’ve seen it before: the greyed-out text in input fields on web forms that shows what example input looks like. Do you know, offhand, what the exact term for such text is? Probably you do. While working on a Django project1 a while ago, I didn’t know precisely what word to use and, oddly enough, searching for the correct term was harder than usual. Computers can be particularly picky.2 Not knowing the exact word to use means that they won’t do what you want them to do. The weird situation I remember being in was not even knowing what to put into the search engine. That…

Commenting on Bubbles has been removed. Why? If you want to talk about this post, write to the author, use the comments on their blog if it has them, or reply with a "RE:" post on your own blog. Suggestions? feedback@bubbles.town