Adamism

20 Mar, 2009

Firefox does it right?

Posted by: adam In: web applications

I received my vehicle registration renewal last week from the Maryland Vehicle Administration. I’m not here to complain about the absurd price ($180? Seriously!)… or standing in line for hours only to be told I need to fill out another form… At the top of my renewal notice it states clearly: “New Option - RENEW ONLINE at WWW.MARYLANDMVA.COM

First of all, there’s nothing new about MarylandMVA.com’s registration renewal. I’ve been using it for years. The look and feel is ancient, but it gets the job done. What I came across today really drove me nuts.

The first step of the renewal process asks you to input your 8 digit vehicle registration number. I get 4 digits in and accidentally mistype. I hit the backspace key, nothing happens. I hit another number… it gets added to my input. Backspace, nothing happens.

Knowing a little about web applications I decided to dig in to see what was going on. The developers of this page wrote a validation function for the registration input:

function validateTitle(field, e) {
	var strCheck = '0123456789ABCDEFGHIJKLMNOPQRSTUVWZXYZabcdefghijklmnopqrstuvwxyz';
	var whichCode = (window.Event) ? e.which : e.keyCode;

	if (whichCode == 13) return true;  // Enter
	key = String.fromCharCode(whichCode);  // Get key value from key code
	//alert(strCheck.indexOf(key));
	if (strCheck.indexOf(key) == -1) return false;  // Not a valid key
}


This function is called each time you press a key on the keyboard while typing in your registration number. It’s a common approach to form validation. The basics are: you hit a key, if it’s the Enter Key, a number or a letter, the character is permitted to be added to the form input. Anything else, the keystroke is denied.

To be fair, there was a warning on the main page that recommended using Internet Explorer. I tried this form in Internet Explorer and the backspace key behaves correctly. My immediate thought was “What about Mac users?” To my surprise, Safari also allows you to backspace without any problem!

The code above should specifically reject any key other than enter, a number, or A-Z. It appears that Safari’s engine Webkit was changed in 2007 to match Internet Explorer — the Backspace key does not trigger a “keypress” event. Firefox does fire a keypress for the backspace key and will therefore prevent you from correcting your mistake on the MVA form.

AFAIK, there’s nothing in the HTML spec that states whether a backspace (or arrow key, etc) should fire the onkeypress event. Should Firefox also try to “closely match Internet Explorer” with this behavior? Or should sites like the MarylandMVA be encouraged to update their sites to support modern/common browsers?

21 Aug, 2008

Bugs

Posted by: adam In: work

As a software developer I deal with “bugs” a lot. If you’re not familiar with the term: a bug is really anything that happens in your program that differs from how it was designed. In the worst case this is a crash, corruption or loss of data. More often a bug is just something a user can do with your program that falls outside of the “rules” you wrote.

I’ve been dealing with a lot of bugs in Wordabble as we’ve been beta testing the next release. Even after I published the release (yesterday) a few minor bugs have been discovered. That can be terribly frustrating… so when I stumbled across this video today it really put a smile on my face. A user of the new Tiger Woods PGA game had discovered a scenario where you could get Tiger to walk on water.

http://www.youtube.com/watch?v=FZ1st1Vw2kY

EA put together a brilliant response. It’s not just the “BLAH, we had a bug, so what” response that all developers love to give… they’ve turned it into a viral marketing spot. They can’t release an update to the game to fix this kind of thing, so their bug fix is to actually make Tiger Woods walk on water.

Absolutely brilliant!

12 Aug, 2008

Movie Posters

Posted by: adam In: adam

Not many people know… but I have a small collection of signed movie posters. The reason no one knows this is: They’re not hanging anywhere. I plan on having a nice display setup in my basement when I complete my “home theater.”

I came across a poster today that I’m considering. I wouldn’t even try to find this signed by the actor … there’s no way it would be affordable.


Isn’t it creepy? He really played a good Joker. I wonder how many Jokers we’ll see this year at Halloween. Probably too many.


  • Lindsey: Hopefully lots of my stuff will fit in the GTI when I move! :)
  • Christopher M.: Twitter and chumby http://blog.twitter.com/2008/0 8/twitterchumby.html
  • Ed: He did make that movie great and that’s one bad ass poster!
  • Jason Lancaster: HAHAHAHHA! Flatulence concerns!? Chris M is the BOMB!
  • Christopher M.: It looks like a calf on the way to local vet in Slovenia capital. http://en.wikipedia.org/wik...

Flickr PhotoStream

    TigerTigerSealPandaButterflyBald Eagle

About

Blogs can be boring… see?