Skip to content

Instantly share code, notes, and snippets.

@masui
Created March 31, 2012 03:24
Show Gist options
  • Save masui/2258965 to your computer and use it in GitHub Desktop.
Save masui/2258965 to your computer and use it in GitHub Desktop.
// validation
$('.zip .editable').editable('click', function(e){
if(e.value.match(/^\d{3}\-\d{4}$/)){
alert(e.target.selector + ' : ' + e.value);
}
else{
$('.zip .editable').html(e.old_value);
alert(e.value + ' is not valid zip-code');
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment