Mjs.Util = {};
Mjs.Util.updateTips = function ( t, context ) {
var tips = $( ".validateTips", context );
tips
.text( t )
.addClass( "ui-state-highlight" );
setTimeout(function() {
tips.removeClass( "ui-state-highlight", 1500 );
}, 500 );
};
Mjs.Util.checkLength = function ( o, n, min, max, context ) {
if ( o.val().length > max || o.val().length < min ) {
o.addClass( "ui-state-error" );
Mjs.Util.updateTips( "Length of " + n + " must be between " +
min + " and " + max + "." , context);
return false;
} else {
return true;
}
};