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() {}

posted @ 2018-03-19 19:58  Arvins  阅读(171)  评论(0编辑  收藏  举报