jordanhollinger (a web log) Ignorance more frequently begets confidence than does knowledge. - Charles Darwin

What does ruthless mean?

Better asked, why does ruthless mean what it means? What is ruth, and why do some things have none of it. Is anyone ever ruthfull?

Example: Daniel Webster was a ruthful man.

Merry Christmas, and Prepare to Meet Thy Maker

Traveling home to West Virginia for Christmas I came upon a hearse. Sad to think about on Christmas Eve Eve Day. But this hearse wasn’t carrying a dead body. It was carrying an old woman, and she was driving it. Emblazoned on the back I could read, “For the wages of sin is death.” A sign affixed to the roof admonished drivers, “Prepare To Meet Thy Maker.”

I found this a rather severe Holiday greeting, so to you I simply say “Merry Christmas!” Or if that offends you I say, “Stop getting offended so easily, and Appropriate Seasonal Festivities!”

Baking Day

Spent the whole day with Alicia making everyone’s Christmas favorites, pretzels + Hershey’s Kisses + M&M’s and Sushi. And my new 50mm lense. Best day in a while.

Diet

This could make millions. …of people healthier.

Oh Tennenbaum

Visiting home for Thanksgiving and putting up the family tree. My mother has been complaining that our tree (plastics make it possible) is too large for our living room. She didn’t appreciate an attempt at compromise.

Neither snow nor rain...

In early October I mailed my rent check like a good tenant. A little later in October I received a letter asking where my rent was. “Oh, they’ll get it soon enough,” said I to myself.

The day before Halloween my landlord called, saying they had received the check that very day, postmarked October 6th. “Curious.”

“Yes,” replied the landlord. “It’s destroyed. Can you send double rent for November?”

I did. They returned my check “for my records,” which I took to mean here.

I accept your apologies, PO. I don’t wish to malign all government services, but juxtaposed with the President’s “my health care plan will succeed just like the Post Office” comment, I find my mail being delivered in a body bag…disquieting.

But at least we know they care.

Daniel Webster is PO'ed

Look at this cat. What got stuck up in his craw and died? He doesn’t look like a man happy about the proliferation of words.

What is he thinking? To prime the pump I’ll throw out Shut up. I wrote the friggin’ dictionary and If they would rather die they had better do it, and decrease the surplus population…of words.

Unobtrusive in-field text labels

Warning: This post concerns Web interface development and may be appear as arcane to many. It also contains HTML and JavaScript examples that may not render properly in feed readers or importers like Facebook. Follow the link back to the original post if you’re having trouble.

In HTML user-input forms, it is not uncommon to see text fields with “labels” as grayed-out text in the field itself which disappear when clicked.

My search for “best practices” on this technique left me…wanting. Firstly, I wasn’t sure what to call it. Secondly, many implementations were riddled with problems, paramount of which was abominable degradation. I am no accessibility expert, but these solutions didn’t even try. Here are two of the most common, and unfortunately, the worst.

Trickle-down

Initially this method looked promising. You explicitly set the value of the field to your label string which trickles down to the defaultValue attribute. You can then use defaultValue to determine when to clear or reset the label. Problems:


  • Mean to screen-readers, non-JavaScript browsers, and those who use them
  • Mean to your controller/form processing code (it somehow has to know to ignore your labels when they’re posted as values)
  • Mean to forms that edit existing data (did defaultValue come from the label or from real data? If it’s real, there is no way to default back to the label if the user removes the value)
  • Depending on the implementation it can be obtrusive

Some of these issues can be resolved through code, but it’s not going to be pretty.

Hidden fields

This, uh, solution, displays a “throw-away” text field as the label. On click, it’s replaced by the real field. To the user it appears that the text just disappeared. This has all the problems above plus some:


  • Really really mean to screen readers and non-JavaScript browsers (there will be duplicate fields with text already in them for no apparent reason)
  • Really mean to controller/form processing code (it has to arbitrarily ignore entire fields, not just values)
  • It’s unbelievably intrusive
  • It’s just a horrible idea on par with suggesting users place and remove labeled Post-it notes when moving from field to field

A better way

First, there may be an Even Better Way, but I believe this address all of the problems above, both practical and conceptual. In a nutshell, you set the field’s title, which you should be doing for accessibility reasons anyway. Optionally add a “real” label tag linked by id to it’s input field. JavaScript then looks for titled fields with blank values, hides their labels, sets the value to the title, and binds focus and blur events to the field. These respectively clear and reset the label (by comparing the value to the title) when users click on or off. On form submit, if any of these fields’ values match their titles, they are cleared by some JavaScript. Benefits:


  • Unobtrusive
  • Graceful degradation (screen-readers and non-JS browsers can fall back on the real label or title attribute)
  • Uses all field attributes for their intended purposes
  • Places all responsibility/logic in one location, removing the need for controllers to treat certain values or fields specially
  • No Post-it notes

A possible draw-back is that users cannot submit a value that matches the field’s title. If that’s a real problem, you could probably add some more checks to hack around it. But how often is someone’s first name First?

My implementation uses >= jQuery 1.3. Since we’re on the Web anyway, I thought I’d throw in a working example below:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<form id="form_field_label_example" action="" method="post">
  <p>
    <label for="first_name">First</label>
    <input id="first_name" name="first" size="15" title="First" type="text" />
    <label for="middle_name">Middle</label>
    <input id="middle_name" name="middle" size="8" title="Middle" type="text" />
    <label for="last">Last</label>
    <input id="last" name="last" size="25" title="Last" type="text" />
</p>
</form>
<script type="text/javascript">
$(document).ready(function() {
  auto_label("form#form_field_label_example input[title][type=text]")
})

function auto_label(str) {
  $(str).each(function() {
    // Hide the field's real label
    $('label[for=' + this.id + ']').hide()

    // Set the label text and color for blank fields
    if ( !this.value || this.value == this.title ) {
      this.value = this.title
      $(this).css('color', '#999')
    } 
      
    // On focus of blank fields, clear the label text and reset the color
    $(this).focus(function() {
      if ( this.value == this.title ) {
        this.value = ''
        $(this).css('color', 'inherit')
      } 
    })
      
    // On unfocus of blank fields, restore the label text and color
    $(this).blur(function() {
      if ( !this.value ) {
        this.value = this.title
        $(this).css('color', '#999')
      }
    })
  })    
        
  // Clear label text when submitting form
  $(str).closest('form').submit(function() {
    $(str).each(function() {
      if ( this.title && this.value == this.title ) { this.value = '' }
    })
  })
}
</script>

Quick, someone get John Wilkes Booth!

I saw Abraham Lincoln recently. Not in a cloud or a potato chip. In person. He showed up for the 150th anniversary of the Murfreesboro courthouse in Murfreesboro, Tennessee. Looking good considering that whole John Wilkes Booth thing. Then he let us do some handstands.

Here's irony for you

So my hard drive just bought the farm. I always tell people to back up their data, and fortunately I was smart enough to listen to my own advice. In fact I wrote my own backup program because I wasn’t fond of the existing solutions.

Pat on the back, right? Unfortunately the most recent backup is about a month old, so I’ve lost some recent work. The irony is of course that the recent work I lost was a major refactoring of the backup program.

What's your car's ringtone, man?

Bloomberg reports electric cars are too quite and are running down the unsuspecting blind, young, and elderly. Clearly this is bad for business.

An early idea was for electric cars to re-create the sound of combustion engines, but fortunately Nissan has taken a stand for aesthetics and is moving towards a “beautiful” and “futuristic” sound, like Blade Runner’s flying cars. The sound is completely artificial, I imagine emanating from an unobtrusive external speaker system.

While that’s awesome, the next logical step is even cooler: custom “ringtones” for your car. Don’t like the flying car loop that came bundled with your Chevy Volt? Upload an mp3 of the Enterprise warp core or George Jetson’s car.

And has anyone thought about what the blind are going to do when we have real flying cars? They won’t know whether to duck or run. This isn’t a solution, people!

Thursdays are best

What’s your favorite day of the week? If it’s Friday, you’re wrong. People look forward to Friday so they can begin their weekends. Thursdays then, must be best, since they hold the maximum potential. Colloquially, “Thursday is the new Friday.” Just sayin’.

How can you be so obtuse, Ubuntu?

I love Ubuntu as much as the next guy (assuming he loves Ubuntu), but this is just horrible, really, really bad UI design.

Firstly, why can’t you just run it on your own, Update Manager? And secondly, run what action now? Every flipping button in the UI could be called that. How can you be so obtuse?

Houseapedia, TV 2.0

I’m not one to watch much TV. My modest flat screen has abandonment issues. And lots of dust. But I did once have a wickedly awesome and dorky idea for a reality TV show. No, it wasn’t dorky because it leveraged audience participation over the Internet. Everyone’s doing that now. It was dorky because it used a wiki. You know, like Wikipedia. Anyone can edit it at any time. (Unless you’re timorously Marked for Speedy Deletion Because We’re Insecure and Afraid No One Will Take Us Seriously).

The show would go like this. A group of random strangers would be thrown in a house to live together. (Obviously nothing new, but since when has the idea really mattered on network television?) The fun part comes in with the wiki. Viewers continually change the house rules, which the contestants are bound to live by. They might have to sleep on the roof. Maybe they can’t use words to communicate; they can only draw pictograms on the walls with hot glue guns. Or eat beats for every meal. Move around the house using monkey bars attached to the ceiling.

Clearly the possibilities are endless. And clearly it’s a good idea. Clearly.

Luddites unite!

Or at least McLuhanites. A few months ago I was hanging out with some friends. We were doing what we often do: watching some banal TV show. I’ve occasionally suggested there are better things we could be doing, but that’s usually met with “what channel?” So I’ve largely given up.

This one particular night it was The Bachelorette. Again, I hate the show but like my friends, so I go along with it. The power flickered. We looked at the lamp. Then it was black. Thirty seconds later it was still black. We went outside and realized it was a beautiful, cool summer night. A moon, plenty of stars, and no street lights. By now all the neighbors were coming out, wondering how far the outage spread. I had never met some of them.

After walking up and down several streets, we realized the whole town was out. Returning to the apartment, we lit some candles. The silence was filled with talk and laughter at stupid anecdotes from our day. We played a game that’s a cross between Telephone and Pictionary. It was best evening we’d had in a very long time. Then the power came back and it was all over.

It would do us well as a culture to lose power 3 or 4 nights a week.