function OnBlurValidate(obj, messageId) { var tempValue = trim(obj.value); var message = document.getElementById(messageId); if (tempValue == "") { MessageShow("", message, false); return true; } else { var regu = /^(/d+)(/.?)(/d{0,2})$/; var re = new RegExp(regu); if (!re.test(tempValue)) { MessageShow("Number must be in this format (###.##) or (###)", message, true); return false; } else { MessageShow("", message, false); return true; } } }