August, 2008


26
Aug 08

Twitter Updates for 2008-08-26

  • At least my blog is popular with the spam bots… #
  • This is a really nice horse, I speak from experience, I once mounted her mother. — Olympic Commentator #
  • Dear Toronto drivers, why did you buy cars without turn-signals? #

25
Aug 08

Twitter Updates for 2008-08-25

  • How is it fair that just because I have a car, I *have* to drive everywhere… just because you have legs doesn’t mean you *have* to walk… #
  • Apparently it means that you get to take my bike without asking and leave it far away so I don’t get to use it. Pay for my gas! #

23
Aug 08

Twitter Updates for 2008-08-23

  • Peterburrah for the weekend #
  • Bento boxes at the Peterboro market #

22
Aug 08

Twitter Updates for 2008-08-22


16
Aug 08

Adding hints

Sometimes it is not totally obvious what you are looking for the user to enter into a text box.

Take this one here:

It is not obvious what we are looking for in this form, By email might is probably an email address. In person is probably an address. Online? That could also be an email address, a skype name, a msn messenger account name, a website…. you get the idea. Other, well, that could be anything, but what is that second box for? To be fair, the form has values in it telling what should be done, I removed those for the sake of the example. That is indeed one way of doing it, but that means that someone has to select all of the text and delete it when they get to that box. I don’t know about you, but I find it a little annoying when I have to do that… So, I started looking for a solution, and I found one that uses jQuery (my javascript library of choice). I could have written it myself of course, its not that hard really:

if(form.input is empty) {
   form.intpu.value = form.input.text
}
if(form.input is clicked){
   form.input.value = ""
}
if(form is unclicked and value = ""){
   form.input.value = form.input.text
}
if(when form is submitted and form.input.value == form.input.text){
   form.input.value == ""
}

I decided to modify that slightly, so that if the form was filled with the value found in text it would be lighter than normal, so:

if(form.input is empty) {
   form.intput.value = form.input.text
   form.css("color", "#999")
}
if(form.input is clicked){
   form.input.value = ""
   form.css("color", "#000")
}
if(form is unclicked and value = ""){
   form.input.value = form.input.text
   form.css("color", "#999")
}
if(when form is submitted and form.input.value == form.input.text){
   form.input.value == ""
}

Here is the final result:

Oh ya, a bonus is that when they hover over it and have javascript turned off it will show the hint as well, and it is screen reader friendly! Accessability is good!

If anyone wants the code I can post it.