Skip to content

Instantly share code, notes, and snippets.

@codewithcats
Created December 29, 2011 06:42
Show Gist options
  • Save codewithcats/1532424 to your computer and use it in GitHub Desktop.
Save codewithcats/1532424 to your computer and use it in GitHub Desktop.
index.jsp script
var errorMsgs = {
txtUSER_NAME: '- โปรดระบุ <bean:message bundle="<%=com.wealth.sellingagent.controller.DefaultDisplay.language%>" key="label.username"/>',
txtPASSWORD: '- โปรดระบุ <bean:message bundle="<%=com.wealth.sellingagent.controller.DefaultDisplay.language%>" key="label.password"/>'
};
$('#loginForm').validate({
onfocusout: false,
onkeyup: false,
onclick: false,
rules: {
txtUSER_NAME: 'required',
txtPASSWORD: 'required'
},
messages: {
txtUSER_NAME: '*',
txtPASSWORD: '*'
},
showErrors: function(errorMap, errorList) {
if(!errorList.length) return;
this.defaultShowErrors();
var msg = '';
for( var k in errorMap) {
msg += errorMsgs[k] + '\n';
}
alert(msg);
}
});
$(document).ready(function() {
$(this).bind('contextmenu', function(e) {e.preventDefault();});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment