Tuesday, November 20, 2012

MooTools More Form.Validator Serial Option Doesn't Do What You Think It Does

MooTools More is pretty great. It has a lot of features that make my life easier. One thing in specific is the Form.Validator class. It makes it super easy to build form validation that works in all browsers.

My one current gripe is the documentation of the serial option. It appears as if it is functioning as expected and actually writing out what it does would be far to wordy for standard documentation.

I started with my standard grade school mathematics approach. Guess and check. I change serial to true. I changed serial to false. I checked to see what it did. I didn't notice anything.

I double checked my code for errors. Nothing. I hopped on Google and found a post to the MooTools user group; Form.Validator "serial" property seems to do nothing. No replies.

Eventually I tracked down an old posting on Lighthouse (MooTools tracked bugs there before GitHub) about the serial option and that shed some light onto the face of things.

The official documentation of the feature is:

  • serial - (boolean) whether to validate other fields if one field fails validation unless the other fields' contents actually change (instead of onblur); defaults to true
A more correct documentation of the feature is:
  • serial - (boolean) whether to validate other fields if one field fails validation unless the other fields' contents actually change (instead of onblur); does not effect number of fields validated onsubmit; defaults to true
I'm pretty sure nobody is ever going to read this. None the less I'm going to post an ad to see how it looks. Ha! Commerce!



Maybe this book would have helped. Maybe not.

Tuesday, November 13, 2012

Capello CR21 Sleep & Charge Dual Alarm Clock

My wife and I have been looking for an alarm clock for quite a few years that fulfill our laundry list of feature requests. We'd find a clock or two along the way but for the most part we had given up looking. We were not going to pay more than $100 for an alarm clock.

I knew the DST change was just around the corner so when we were at Target I picked this one up because it had our most basic desired feature - dual alarm clocks. Not just two different times for the same alarm but two separate alarms. $30 at Target wasn't much and we could always return it if it was junk.

I got it home added my radio presets. Set the alarm and went about my day. Time for sleeping so I turned on the radio hit the sleep timer and nodded off to the dulcet tones of BBC World. 3 hours later I woke up and the radio was still on. Maybe my wife hit the button or maybe I didn't do it right. I didn't know. Didn't matter. It was 3am and I wanted the radio to stop so I turned it off.

The next night the same thing happened. I turned on the sleep timer and woke up in the middle of the night when the radio was still on. So I experimented. Did it turn off at all? Did I not read the manual correctly? What was going on. I deduced that I was following the directions as printed correctly but the radio was not turning off (even though the sleep timer LED did).

So I sent an email out to Capello support asking about the CR21 and got a response in a timely fashion. They notified me that they had identified a portion of the manufactured radios did not have a proper sleep function and would send me a replacement. The email mentioned that I should not take the radio back to Target.

Right here it seems a little fishy. There are very few times a manufacturer would actually prefer you to not deal with a retailer. Either (A) Capello didn't want me to let the people at Target know that the radio is busted because Target Corp would drop the hammer on Capello or (B) Capello knows that so many of the radios were manufactured with the defect that I would just be getting a replacement with the same problem.

I sent them my shipping information and within a week my UPS account notified me that I had a package on the way. At this point it is interesting to note that at no time did Capello require any proof that I purchased the product. I don't know if this was just the person I was dealing what but it seemed a bit odd.

On Friday I came home to the usual UPS yellow sticker on my window that a package from "Life lab" had been attempted to be delivered but wasn't because it required someone show an ID verifying that they were over the age of 21. Life Lab sent something that is potentially adult in nature? I asked my wife if she ordered a cloning kit or something potentially dangerous but she didn't. I looked up the tracking numbers and sure enough it was the replacement alarm clock. I don't know who Life Lab is or what branch of theirs is Capello and I don't really care.

The bigger question is why did Capello send me my replacement CR21 requiring an adult's signature. It is just an alarm clock after all. If I had suspected that they would do such a thing I would have had it shipped to my work place where people are accepting packages all day long. But no. It was just an alarm clock. I couldn't suspect that they'd send it anything other than baseline shipping.

On Monday I came home to the same sticker. Package from Life Lab. Needing verification that I'm an adult. At this point I know that I'm not going to get the package on the third attempt and I'm not going to have them return the package to sender. I've been sleeping without a background noise for more than a week now.

I did eventually get to my local UPS distribution center to pick up my package. When the lady behind the counter saw it required a 21+ signature she gave me a raised eyebrow look before she handed over the box. "It is an alarm clock." I assured her. "I have no idea why they sent it requiring an adult signature."

I got the Capello CR21 home and sure enough it is exactly the same as the clock I had purchased from Target weeks before with the exception that it was manufactured later. My original clock had a serial number in the 2000 range and a sticker proclaiming MANUFACTURED JULY 2012 while the replacement had a serial number in the 4000 range and SEPTEMBER 2012 date. Fortunately, this clock has a functioning sleep timer.

So the moral of the story. If you buy a Capello Sleep & Charge Dual Alarm Clock CR21 from Target and the Sleep Timer doesn't work you should contact Capello directly and have them ship it to a location where you know somebody will be able to sign for the package.