Hi,
Use this code to show an notification if less than 12 characters are entered
var fieldVal = Xrm.Page.getAttribute("your_field_name").getValue();
if(fieldVal.length < 12)
{
Xrm.Page.getControl("your_field_name").setNotification("Needs to be exact 12 characters");
Xrm.Page.getAttribute("your_field_name").setValue("");
}
Add this code to the onChange of your field.
Admin QuikView Solution for CRM 2013