mailboxes

Forms are Fantastic with “Ziptastic CSS and JQuery “

mailboxes
provided by the USPS

Here’s my thoughts. This API is a great addition to any form on a website. I was reviewing the code and suggested to the author a code change in a recent email message. I think Chris Coyier is a fantastic demo creator and the author Andru Skoicescu followed through with a great idea. I downloaded the demo and can hardly wait to implement this on a website.

ATTENTION: AFTER BRINGING THIS TO THE AUTHORS ATTENTION HE FIXED IT AS I SUGGESTED.

download it from github. http://daspecster.github.io/ziptastic/index.html

You will see the line that says Ghetto. I don’t know about you, but I don’t like the word Ghetto in my code. Now my fix is below the commented out code.

if (firstReveal) {

    // Ghetto but without this timeout the field doesn't
    // take focus for some reason.
    //setTimeout(function() { $("#address-line-1").focus(); }, 400);

My Fix:

    $("#zip").blur();
    $("#address-line-1").show().focus();

}

If you had it hidden it from the previous step in the code then you need to show it before you can put the focus on the form field. This worked for me in Chrome. Let me know if this didn’t work.

Advertisements