B and E Blog

Just a couple of opinionated nerds talking about ColdFusion, PHP, and technology in general.

B and E Blog header image 4

Spry Email Validation

March 31st, 2008 · 1 Comment · Programming

First you have to include the js and css files for the spry framework. In this example taken from the spry demos we have two files. Both are designed for text fields.

<link href=”../../widgets/textfieldvalidation/SpryValidationTextField.css” rel=”stylesheet” type=”text/css”>
<script type=”text/javascript” src=”../../widgets/textfieldvalidation/SpryValidationTextField.js”>

The actual form field will be wrapped in a div or span tag with an id. Any [...]

[Read more →]

Tags: ··

Regular Expression for Validating Email Addresses

March 27th, 2008 · 2 Comments · Programming, Regular Expressions

This is the regular expression I use to validate email addresses:

^[&'*+\/=?^_{}~a-z0-9.-]+@([a-z0-9-]+\.)+[a-z0-9]+$

Thought it might be useful to some folks. Most email validation regular expressions fail to allow all the valid characters before the @ sign (for example, you can have a +, an & slashes, a single quote, =, ?, ^, _, {, }, ~, [...]

[Read more →]

Tags: ·