Max Beatty

    Simplified. Secure. Semantic.

    Allowing Gmail + Filters in JavaScript Form Validation

    A few weeks ago I learned about a great Gmail feature that allows you to filter your email with personalized email addresses using a plus sign. For example, if you think you’ll be spammed by signing up for something like a forum, you could sign up with the email username+forum@gmail.com and setup a filter to automatically mark those messages as spam.

    Both of my current projects at Sproutbox and the Eppley Institute involve setting up or testing user systems. To do this, I make a lot of dummie test accounts but these accounts need to have valid email addresses to test things like password recovery. Instead of racking my brain for every email address I have ever created, I started registering test accounts with emails such as username+tester1@gmail.com.

    This was working great until today in Joomla my email addresses weren’t validating with their JavaScript validation script. Luckily, it was easy to see how they were validating email addresses.

    scrnr-validateInside the validate.js script was a small function that used a regular expression to make sure entered email addresses were in the traditional form of Username09@Domain1.com.

    this.setHandler('email',
    function (value) {
    regex=/^[a-zA-Z0-9._-]+@([a-zA-Z0-9.-]+\.)+[a-zA-Z0-9.-]{2,4}$/;
    return regex.test(value);
    });

    If you’ve never seen or used regular expressions before, they are very powerful and awesome but can be overwhelming at first. All that expression is saying – “Look at the beginning of the line and make sure there are only upper and lowercase letters, numbers zero though nine, periods, underscores, and dashes before at least one at sign.” The rest of it goes the same way.

    So to allow plus signs in the first part of the email address you just add a ‘+’ after the ‘-’ and before the ‘]’.

    regex=/^[a-zA-Z0-9._-+]+@([a-zA-Z0-9.-]+\.)+[a-zA-Z0-9.-]{2,4}$/;

    Now it will allow email addresses that look like Username90+whatever@Domain1.com.

    If you’re a developer and want to be nice to your users, make sure to remember to add this ‘+’ in your form validation scripts so that soon-to-be Gmail ninjas like me can filter your spam newsletters accordingly.

    Pavilion Properties: I caught you lying

     

    Businesses have to learn to admit when they are wrong and be somewhat transparent about their alternative motives. It’s a new world where if you aren’t customers like me have to call you out. Today’s example is Pavilion Properties, the best worst real estate management firm in Bloomington, Indiana. I politely emailed one of the owners, Mark Hoffman, about when we would be receiving our security deposit. Here’s what he said

    Read the rest of this entry »

    Fun Family Fact About Bloomington’s Fun Frolic

    This weekend is the end of the annual Fun Frolic in Bloomington. If you don’t know, the Fun Frolic is “a family-friendly Bloomington tradition since 1957, the Fun Frolic features rides, games, amusements and traditional carnival food. Proceeds benefit Big Brothers Big Sisters of South Central Indiana and IU Child Care.”

    What some might not have known is that John Mellencamp used the Fun Frolic as the setting for his 1985 music video for “Lonely Ol’ Night” (embedding was disabled :( )

    Something cool I learned yesterday from my mom is that my Uncle Ray is actually in the video! Check him and his then-girlfriend out at around 2:46

    My Uncle Ray makes a cameo in a John Mellencamp video

    My Uncle Ray makes a cameo in a John Mellencamp video

    I thought it was a little trivia that should be shared with the world. I don’t know how I never heard about the Fun Frolic until this year or how I’d gone my entire life without knowing my uncle was in a music video!

    Thanks PizzaX

    On Friday, I finally got back to Bloomington to pick up a stack of cups with my Little 500 logo from PizzaX (formerly Pizza Express) that they had set aside just for me and wanted to thank them publicly for their small effort that meant a lot to me. Read the rest of this entry »

    New Business Cards For My Old Man

    This morning my dad and I sat around playing with some new ideas for his business cards and overall brand. You can see his old logo on his site. The redesign and rebranding stems from wanting to be clearer about what he does as a business while at the same time simplifying his office setup. Instead of having a landline phone number and mobile number, he’s just going to have one. Instead of paying for a fax line, he’s going to do more email invoices and electronic faxes. It’s smart and more efficient, but that wasn’t the point of this blog.

    I just felt like posting a few of the ideas I had to redesign his logo and business card. It’s very minimal, not a lot of color (still cheapest to print black and white), and it was meant to transfer between business cards, invoice headings, yard signs, and print advertisements. Keep in mind I have no training whatsoever in graphic design or print design. Here goes: Read the rest of this entry »

    Subscribe to my blog or chat with me!