js2
function login() {
var username = $('#username').val();
var pwd = $('#pwd').val();
var flag = true;
if(username == null || username == '') {
$('#usermsg').html('<font color=red>用户名不能为空</font>');
flag = false;
}
if(pwd == null || pwd == '') {
$('#pwdmsg').html('<font color=red>密码不能为空</font>');
flag = false;
}
if(flag) {
//访问servlet
var form1 = $('#userform')[0];
form1.action='LoginServlet';
form1.submit();
}
}
function backon() {}
function register() {}